From 2b2dbf43f11aecf778ff118dd1da1af9726f36e6 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 22 Nov 2007 23:52:58 +0000 Subject: - Changed the status_change structure to use dynamic rather than static memory to hold the individual status changes, this should have a noticeable impact on the server's memory consumption. - Had to add a few 'ugly' flags to status_change since now you can't track SC related information while said SC is not active (happens only for Storm Gust, Joint Beat and Magic Power). - Since I am unable to fully test, watch out for any bugs~ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11786 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 5cff144b9..d113e8a6d 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -454,17 +454,17 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) skill_unit_move(bl,tick,2); sc = status_get_sc(bl); if (sc && sc->count) { - if (sc->data[SC_CLOSECONFINE].timer != -1) + if (sc->data[SC_CLOSECONFINE]) status_change_end(bl, SC_CLOSECONFINE, -1); - if (sc->data[SC_CLOSECONFINE2].timer != -1) + if (sc->data[SC_CLOSECONFINE2]) status_change_end(bl, SC_CLOSECONFINE2, -1); -// if (sc->data[SC_BLADESTOP].timer != -1) //Won't stop when you are knocked away, go figure... +// if (sc->data[SC_BLADESTOP]) //Won't stop when you are knocked away, go figure... // status_change_end(bl, SC_BLADESTOP, -1); - if (sc->data[SC_BASILICA].timer != -1) + if (sc->data[SC_BASILICA]) status_change_end(bl, SC_BASILICA, -1); - if (sc->data[SC_TATAMIGAESHI].timer != -1) + if (sc->data[SC_TATAMIGAESHI]) status_change_end(bl, SC_TATAMIGAESHI, -1); - if (sc->data[SC_MAGICROD].timer != -1) + if (sc->data[SC_MAGICROD]) status_change_end(bl, SC_MAGICROD, -1); } } else @@ -484,12 +484,12 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) skill_unit_move(bl,tick,3); if (sc) { if (sc->count) { - if (sc->data[SC_CLOAKING].timer != -1) - skill_check_cloaking(bl, sc); - if (sc->data[SC_DANCING].timer != -1) - skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING].val2, bl->m, x1-x0, y1-y0); - if (sc->data[SC_WARM].timer != -1) - skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_WARM].val4, bl->m, x1-x0, y1-y0); + if (sc->data[SC_CLOAKING]) + skill_check_cloaking(bl, sc->data[SC_CLOAKING]); + if (sc->data[SC_DANCING]) + skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING]->val2, bl->m, x1-x0, y1-y0); + if (sc->data[SC_WARM]) + skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_WARM]->val4, bl->m, x1-x0, y1-y0); } } } else @@ -3073,6 +3073,7 @@ void do_final(void) do_final_guild(); do_final_party(); do_final_pc(); + do_final_status(); do_final_pet(); do_final_mob(); do_final_msg(); -- cgit v1.2.3-70-g09d2