summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-01 18:42:35 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-01 18:42:35 +0000
commit67a0736c51678e453497660ef7df7bd601e57101 (patch)
tree0e908e5b0dbfb84632347d71aeda3b3a4a93913a /src/map/unit.c
parent2d2262df9727b962135d39b6f22a1a092dc80175 (diff)
downloadhercules-67a0736c51678e453497660ef7df7bd601e57101.tar.gz
hercules-67a0736c51678e453497660ef7df7bd601e57101.tar.bz2
hercules-67a0736c51678e453497660ef7df7bd601e57101.tar.xz
hercules-67a0736c51678e453497660ef7df7bd601e57101.zip
performance improvement initial commit for status change state functionality, this first commit covers status that makes you unable to move.
-- this cache the status changes into states saving dozens of checks whenever a unit moves/per cell. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16209 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index e58c003e9..47f9b5a39 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -886,45 +886,15 @@ int unit_can_move(struct block_list *bl)
return 0; //Can't move
if (sc) {
+ if( sc->cant.move )
+ return 0;
+
if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING)
return 0;
if ((sc->option & OPTION_HIDE) && (!sd || pc_checkskill(sd, RG_TUNNELDRIVE) <= 0))
return 0;
- if (sc->count && (
- sc->data[SC_ANKLE]
- || sc->data[SC_AUTOCOUNTER]
- || sc->data[SC_TRICKDEAD]
- || sc->data[SC_BLADESTOP]
- || sc->data[SC_BLADESTOP_WAIT]
- || (sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
- || (sc->data[SC_DANCING] && sc->data[SC_DANCING]->val4 && (
- !sc->data[SC_LONGING] ||
- (sc->data[SC_DANCING]->val1&0xFFFF) == CG_MOONLIT ||
- (sc->data[SC_DANCING]->val1&0xFFFF) == CG_HERMODE
- ))
- || (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF) // cannot move while gospel is in effect
- || (sc->data[SC_BASILICA] && sc->data[SC_BASILICA]->val4 == bl->id) // Basilica caster cannot move
- || sc->data[SC_STOP]
- || sc->data[SC_CLOSECONFINE]
- || sc->data[SC_CLOSECONFINE2]
- || (sc->data[SC_CLOAKING] && //Need wall at level 1-2
- sc->data[SC_CLOAKING]->val1 < 3 && !(sc->data[SC_CLOAKING]->val4&1))
- || sc->data[SC_MADNESSCANCEL]
- || (sc->data[SC_GRAVITATION] && sc->data[SC_GRAVITATION]->val3 == BCT_SELF)
- || sc->data[SC_WHITEIMPRISON]
- || sc->data[SC_ELECTRICSHOCKER]
- || sc->data[SC_BITE]
- || sc->data[SC_THORNSTRAP]
- || sc->data[SC_MAGNETICFIELD]
- || sc->data[SC__MANHOLE]
- || sc->data[SC_VACUUM_EXTREME]
- || (sc->data[SC_FEAR] && sc->data[SC_FEAR]->val2 > 0)
- || sc->data[SC_CURSEDCIRCLE_ATKER]
- || sc->data[SC_CURSEDCIRCLE_TARGET]
- ))
- return 0;
}
return 1;
}