summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-27 18:02:20 -0200
committershennetsind <ind@henn.et>2013-10-27 18:02:20 -0200
commit6cec6e91de4f7490a48a5a145ab3d54efc7fc2c1 (patch)
treed3accf00aab232dea6c2b1f4104d3b50d6485f59 /src/map/unit.c
parent830aa82793adc2a009e12d9eb9eda20e29a0c9a8 (diff)
downloadhercules-6cec6e91de4f7490a48a5a145ab3d54efc7fc2c1.tar.gz
hercules-6cec6e91de4f7490a48a5a145ab3d54efc7fc2c1.tar.bz2
hercules-6cec6e91de4f7490a48a5a145ab3d54efc7fc2c1.tar.xz
hercules-6cec6e91de4f7490a48a5a145ab3d54efc7fc2c1.zip
Performance Improvement: hpmeter
whenever a character's hp was modified (e.g. damage/heal), clif_hpmeter would look for nearby characters with the PC_PERM_VIEW_HPMETER permission (foreachinarea operation), and since most of the time there isn't such a char nearby it would needlessly consume processing power, now hpmeter is only triggered when there are actual need (when a character with such capabilities is within the map). as little as this may look like, its a mega boost for damage-intensive areas e.g. woe, whereas a single AoE damaging 10 people would, without this, trigger foreachinarea 10 times one very hit. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 7b4ac2c50..08e97cfee 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2194,6 +2194,10 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i
instance->list[map->list[bl->m].instance_id].users--;
instance->check_idle(map->list[bl->m].instance_id);
}
+ if( sd->state.hpmeter_visible ) {
+ map->list[bl->m].hpmeter_visible--;
+ sd->state.hpmeter_visible = 0;
+ }
sd->state.debug_remove_map = 1; // temporary state to track double remove_map's [FlavioJS]
sd->debug_file = file;
sd->debug_line = line;