summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 06:46:57 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 06:46:57 +0000
commit6669de77431e0bb6548bdcbb13a6cf13f40b247f (patch)
tree5f374064a47b94ad9a7cbb8b3ce08305b7e58327 /src/map/status.c
parentf87f36b82dbf7f907555fed2fdd8efab8f869ea6 (diff)
downloadhercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.gz
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.bz2
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.xz
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.zip
* Changed function-like macros into inline functions where it seemed appropriate (topic:264007).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14976 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 3ec822a6a..26c0c1b2f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -599,6 +599,14 @@ static void initDummyData(void)
dummy_status.mode = MD_CANMOVE;
}
+
+//For copying a status_data structure from b to a, without overwriting current Hp and Sp
+static inline void status_cpy(struct status_data* a, const struct status_data* b)
+{
+ memcpy((void*)&a->max_hp, (const void*)&b->max_hp, sizeof(struct status_data)-(sizeof(a->hp)+sizeof(a->sp)));
+}
+
+
/*==========================================
* B{[iX
*------------------------------------------*/
@@ -1320,8 +1328,18 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct
return cap_value(str, 0, USHRT_MAX);
}
-#define status_base_matk_max(status) (status->int_+(status->int_/5)*(status->int_/5))
-#define status_base_matk_min(status) (status->int_+(status->int_/7)*(status->int_/7))
+
+static inline unsigned short status_base_matk_max(const struct status_data* status)
+{
+ return status->int_+(status->int_/5)*(status->int_/5);
+}
+
+
+static inline unsigned short status_base_matk_min(const struct status_data* status)
+{
+ return status->int_+(status->int_/7)*(status->int_/7);
+}
+
//Fills in the misc data that can be calculated from the other status info (except for level)
void status_calc_misc(struct block_list *bl, struct status_data *status, int level)