diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-16 12:18:24 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-16 12:18:24 +0000 |
commit | eae90264e5ec4170f716cdf6eed706d3d784233e (patch) | |
tree | 33d56947c216ad4e105707592faedd2e826e9e74 /src/map/script.c | |
parent | de678dc8a2d4450a91f9b4c2a205b294a8b678eb (diff) | |
download | hercules-eae90264e5ec4170f716cdf6eed706d3d784233e.tar.gz hercules-eae90264e5ec4170f716cdf6eed706d3d784233e.tar.bz2 hercules-eae90264e5ec4170f716cdf6eed706d3d784233e.tar.xz hercules-eae90264e5ec4170f716cdf6eed706d3d784233e.zip |
* Some cleanups related to player and monster states.
- Moved user_font and bg_id out of states as they are data, not states.
- Reordered members of state structs so that bitfields are packed together (less memory gets wasted).
- Other insignificant code tweaks.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14795 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c index 4e874b5f0..4f565b9ed 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6316,7 +6316,7 @@ BUILDIN_FUNC(getcharid) case 1: script_pushint(st,sd->status.party_id); break; case 2: script_pushint(st,sd->status.guild_id); break; case 3: script_pushint(st,sd->status.account_id); break; - case 4: script_pushint(st,sd->state.bg_id); break; + case 4: script_pushint(st,sd->bg_id); break; default: ShowError("buildin_getcharid: invalid parameter (%d).\n", num); script_pushint(st,0); @@ -14239,7 +14239,7 @@ BUILDIN_FUNC(bg_monster_set_team) if( (mbl = map_id2bl(id)) == NULL || mbl->type != BL_MOB ) return 0; md = (TBL_MOB *)mbl; - md->state.bg_id = bg_id; + md->bg_id = bg_id; mob_stop_attack(md); mob_stop_walking(md, 0); @@ -14252,7 +14252,7 @@ BUILDIN_FUNC(bg_monster_set_team) BUILDIN_FUNC(bg_leave) { struct map_session_data *sd = script_rid2sd(st); - if( sd == NULL || !sd->state.bg_id ) + if( sd == NULL || !sd->bg_id ) return 0; bg_team_leave(sd,0); @@ -14658,10 +14658,10 @@ BUILDIN_FUNC(setfont) if( sd == NULL ) return 0; - if( sd->state.user_font != font ) - sd->state.user_font = font; + if( sd->user_font != font ) + sd->user_font = font; else - sd->state.user_font = 0; + sd->user_font = 0; clif_font(sd); return 0; |