summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-23 03:14:57 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-23 03:14:57 +0000
commit7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37 (patch)
tree32d69f53bacb7597d55e5a27839dde6d952aca77 /src/map/map.c
parenta278eb2e074ce0cb0c9c68e372c66b87f84577a1 (diff)
downloadhercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.gz
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.bz2
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.xz
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.zip
* map_addflooritem and struct item_drop_list using id's instead of struct map_session_data's (fixes bugreport:36).
* Fixed buildin_escape_sql not properly escaping in sql servers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11279 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 2476e0e0e..8084881ca 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1544,20 +1544,18 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
* item_dataはamount以外をcopyする
* type flag: &1 MVP item. &2 do stacking check.
*------------------------------------------*/
-int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,struct map_session_data *first_sd,
- struct map_session_data *second_sd,struct map_session_data *third_sd,int type)
+int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_id,int second_id,int third_id,int flags)
{
int r;
- unsigned int tick;
struct flooritem_data *fitem=NULL;
nullpo_retr(0, item_data);
- if(!map_searchrandfreecell(m,&x,&y,type&2?1:0))
+ if(!map_searchrandfreecell(m,&x,&y,flags&2?1:0))
return 0;
r=rand();
- fitem = (struct flooritem_data *)aCalloc(1,sizeof(*fitem));
+ CREATE(fitem, struct flooritem_data, 1);
fitem->bl.type=BL_ITEM;
fitem->bl.prev = fitem->bl.next = NULL;
fitem->bl.m=m;
@@ -1569,28 +1567,12 @@ int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,struct
return 0;
}
- tick = gettick();
- if(first_sd) {
- fitem->first_get_id = first_sd->bl.id;
- if(type&1)
- fitem->first_get_tick = tick + battle_config.mvp_item_first_get_time;
- else
- fitem->first_get_tick = tick + battle_config.item_first_get_time;
- }
- if(second_sd) {
- fitem->second_get_id = second_sd->bl.id;
- if(type&1)
- fitem->second_get_tick = tick + battle_config.mvp_item_first_get_time + battle_config.mvp_item_second_get_time;
- else
- fitem->second_get_tick = tick + battle_config.item_first_get_time + battle_config.item_second_get_time;
- }
- if(third_sd) {
- fitem->third_get_id = third_sd->bl.id;
- if(type&1)
- fitem->third_get_tick = tick + battle_config.mvp_item_first_get_time + battle_config.mvp_item_second_get_time + battle_config.mvp_item_third_get_time;
- else
- fitem->third_get_tick = tick + battle_config.item_first_get_time + battle_config.item_second_get_time + battle_config.item_third_get_time;
- }
+ fitem->first_get_id = first_id;
+ fitem->first_get_tick = gettick() + (flags&1 ? battle_config.mvp_item_first_get_time : battle_config.item_first_get_time);
+ fitem->second_get_id = second_id;
+ fitem->second_get_tick = fitem->first_get_tick + (flags&1 ? battle_config.mvp_item_second_get_time : battle_config.item_second_get_time);
+ fitem->third_get_id = third_id;
+ fitem->third_get_tick = fitem->second_get_tick + (flags&1 ? battle_config.mvp_item_third_get_time : battle_config.item_third_get_time);
memcpy(&fitem->item_data,item_data,sizeof(*item_data));
fitem->item_data.amount=amount;