From 388961002f81f1e8ddd5343c54d510af0ad5bdc6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Feb 2016 01:54:34 +0300 Subject: Add support for item attribute MaxFloorOffset. Change plugin version to 12. --- src/emap/map.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/emap/map.c') diff --git a/src/emap/map.c b/src/emap/map.c index 67d279d..e08d31f 100644 --- a/src/emap/map.c +++ b/src/emap/map.c @@ -74,15 +74,18 @@ int emap_addflooritem_post(int retVal, int *flags __attribute__ ((unused))) { TBL_ITEM* fitem = (TBL_ITEM*)idb_get(map->id_db, retVal); - if (fitem && fitem->cleartimer != INVALID_TIMER) + if (fitem) { - int timeout = battle->bc->flooritem_lifetime; - struct ItemdExt *data = itemd_get_by_item(item); - if (data) - timeout = data->floorLifeTime; - timer->delete(fitem->cleartimer, map->clearflooritem_timer); - if (timeout >= 0) - fitem->cleartimer = timer->add(timer->gettick() + timeout, map->clearflooritem_timer, fitem->bl.id, 0); + if (fitem->cleartimer != INVALID_TIMER) + { + int timeout = battle->bc->flooritem_lifetime; + struct ItemdExt *data = itemd_get_by_item(item); + if (data) + timeout = data->floorLifeTime; + timer->delete(fitem->cleartimer, map->clearflooritem_timer); + if (timeout >= 0) + fitem->cleartimer = timer->add(timer->gettick() + timeout, map->clearflooritem_timer, fitem->bl.id, 0); + } } return retVal; } -- cgit v1.2.3-60-g2f50