diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-11-22 15:44:17 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-11-22 15:44:17 +0000 |
commit | 951a736ea97701dcde48c6085a596de96bafce45 (patch) | |
tree | 4aa30fc79780452937ea476e68b1a3013bc9c57c /src/map | |
parent | 82ed8e76484c53edb394191d95da9d1fad77bbe1 (diff) | |
download | hercules-951a736ea97701dcde48c6085a596de96bafce45.tar.gz hercules-951a736ea97701dcde48c6085a596de96bafce45.tar.bz2 hercules-951a736ea97701dcde48c6085a596de96bafce45.tar.xz hercules-951a736ea97701dcde48c6085a596de96bafce45.zip |
* Hunted down the simpler 64bit pointer truncations.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13380 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/guild.c | 2 | ||||
-rw-r--r-- | src/map/mob.c | 6 | ||||
-rw-r--r-- | src/map/npc.c | 8 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/pet.c | 4 | ||||
-rw-r--r-- | src/map/script.c | 2 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
10 files changed, 17 insertions, 17 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index cb438701c..48e9a0720 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8739,7 +8739,7 @@ int atcommand_commands(const int fd, struct map_session_data* sd, const char* co slen = (unsigned int)strlen(atcommand_info[i].command); // flush the text buffer if this command won't fit into it - if( ((CHATBOX_SIZE-1+(int)line_buff)-(int)cur) < (int)slen ) + if( slen + cur - line_buff >= CHATBOX_SIZE ) { clif_displaymessage(fd,line_buff); cur = line_buff; diff --git a/src/map/battle.c b/src/map/battle.c index 850a0aea9..879e6c0db 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -206,7 +206,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, dat->distance = distance_bl(src, target)+10; //Attack should connect regardless unless you teleported. if (src->type != BL_PC && amotion > 1000) amotion = 1000; //Aegis places a damage-delay cap of 1 sec to non player attacks. [Skotlex] - add_timer(tick+amotion, battle_delay_damage_sub, src->id, (int)dat); + add_timer(tick+amotion, battle_delay_damage_sub, src->id, (intptr)dat); return 0; } diff --git a/src/map/clif.c b/src/map/clif.c index 81902f4e4..46e9c0fb9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -633,7 +633,7 @@ int clif_clearunit_area(struct block_list* bl, uint8 type) static int clif_clearunit_delayed_sub(int tid, unsigned int tick, int id, intptr data) { - struct block_list *bl = (struct block_list *)id; + struct block_list *bl = (struct block_list *)data; clif_clearunit_area(bl, 0); aFree(bl); return 0; @@ -644,7 +644,7 @@ int clif_clearunit_delayed(struct block_list* bl, unsigned int tick) struct block_list *tbl; tbl = (struct block_list*)aMalloc(sizeof (struct block_list)); memcpy (tbl, bl, sizeof (struct block_list)); - add_timer(tick, clif_clearunit_delayed_sub, (int)tbl, 0); + add_timer(tick, clif_clearunit_delayed_sub, 0, (intptr)tbl); return 0; } diff --git a/src/map/guild.c b/src/map/guild.c index a12d1544d..8f9137943 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1874,7 +1874,7 @@ int guild_castlealldataload(int len,struct guild_castle *gc) } // update mapserver castle data with new info - memcpy(&c->guild_id, &gc->guild_id, sizeof(struct guild_castle) - ((int)&c->guild_id - (int)c)); + memcpy(&c->guild_id, &gc->guild_id, sizeof(struct guild_castle) - ((uintptr)&c->guild_id - (uintptr)c)); if( c->guild_id ) { diff --git a/src/map/mob.c b/src/map/mob.c index 1daeda3b0..de1ad7294 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1632,7 +1632,7 @@ static int mob_delay_item_drop(int tid, unsigned int tick, int id, intptr data) { struct item_drop_list *list; struct item_drop *ditem, *ditem_prev; - list=(struct item_drop_list *)id; + list=(struct item_drop_list *)data; ditem = list->item; while (ditem) { map_addflooritem(&ditem->item_data,ditem->item_data.amount, @@ -2218,7 +2218,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) mob_item_drop(md, dlist, mob_setlootitem(&md->lootitem[i]), 1, 10000, 0); } if (dlist->item) //There are drop items. - add_timer(tick + (!battle_config.delay_battle_damage?500:0), mob_delay_item_drop, (int)dlist, 0); + add_timer(tick + (!battle_config.delay_battle_damage?500:0), mob_delay_item_drop, 0, (intptr)dlist); else //No drops ers_free(item_drop_list_ers, dlist); } else if (md->lootitem && md->lootitem_count) { //Loot MUST drop! @@ -2232,7 +2232,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) dlist->item = NULL; for(i = 0; i < md->lootitem_count; i++) mob_item_drop(md, dlist, mob_setlootitem(&md->lootitem[i]), 1, 10000, 0); - add_timer(tick + (!battle_config.delay_battle_damage?500:0), mob_delay_item_drop, (int)dlist, 0); + add_timer(tick + (!battle_config.delay_battle_damage?500:0), mob_delay_item_drop, 0, (intptr)dlist); } if(mvp_sd && md->db->mexp > 0 && !md->special_state.ai) diff --git a/src/map/npc.c b/src/map/npc.c index 592bd88f1..a347cd128 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -434,9 +434,9 @@ int npc_timerevent(int tid, unsigned int tick, int id, intptr data) - nd->u.scr.timer_event[ ted->next-1 ].timer; ted->time+=next; if (sd) - sd->npc_timer_id = add_timer(tick+next,npc_timerevent,id,(int)ted); + sd->npc_timer_id = add_timer(tick+next,npc_timerevent,id,(intptr)ted); else - nd->u.scr.timerid = add_timer(tick+next,npc_timerevent,id,(int)ted); + nd->u.scr.timerid = add_timer(tick+next,npc_timerevent,id,(intptr)ted); } else { if (sd) sd->npc_timer_id = -1; @@ -500,9 +500,9 @@ int npc_timerevent_start(struct npc_data* nd, int rid) next = nd->u.scr.timer_event[j].timer - nd->u.scr.timer; ted->time = nd->u.scr.timer_event[j].timer; if (sd) - sd->npc_timer_id = add_timer(gettick()+next,npc_timerevent,nd->bl.id,(int)ted); + sd->npc_timer_id = add_timer(gettick()+next,npc_timerevent,nd->bl.id,(intptr)ted); else - nd->u.scr.timerid = add_timer(gettick()+next,npc_timerevent,nd->bl.id,(int)ted); + nd->u.scr.timerid = add_timer(gettick()+next,npc_timerevent,nd->bl.id,(intptr)ted); return 0; } /*========================================== diff --git a/src/map/pc.c b/src/map/pc.c index 4efdff069..d4483a3f7 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6393,7 +6393,7 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) if( i == MAX_EVENTTIMER ) return 0; - sd->eventtimer[i] = add_timer(gettick()+tick, pc_eventtimer, sd->bl.id, (int)aStrdup(name)); + sd->eventtimer[i] = add_timer(gettick()+tick, pc_eventtimer, sd->bl.id, (intptr)aStrdup(name)); sd->eventcount++; return 1; diff --git a/src/map/pet.c b/src/map/pet.c index 8c9ce1610..7089875c9 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -955,7 +955,7 @@ static int pet_delay_item_drop(int tid, unsigned int tick, int id, intptr data) { struct item_drop_list *list; struct item_drop *ditem, *ditem_prev; - list=(struct item_drop_list *)id; + list=(struct item_drop_list *)data; ditem = list->item; while (ditem) { map_addflooritem(&ditem->item_data,ditem->item_data.amount, @@ -1012,7 +1012,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd) pd->ud.canact_tick = gettick()+10000; // 10*1000msの間拾わない if (dlist->item) - add_timer(gettick()+540,pet_delay_item_drop,(int)dlist,0); + add_timer(gettick()+540,pet_delay_item_drop,0,(intptr)dlist); else ers_free(item_drop_list_ers, dlist); return 1; diff --git a/src/map/script.c b/src/map/script.c index 127ebcde1..2786f082b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3150,7 +3150,7 @@ void run_script_main(struct script_state *st) //Delay execution st->sleep.charid = sd?sd->status.char_id:0; st->sleep.timer = add_timer(gettick()+st->sleep.tick, - run_script_timer, st->sleep.charid, (int)st); + run_script_timer, st->sleep.charid, (intptr)st); linkdb_insert(&sleep_db, (void*)st->oid, st); //Restore previous script if (sd) { diff --git a/src/map/unit.c b/src/map/unit.c index 7373ebab1..812c70b47 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -803,7 +803,7 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int //Resume running after can move again [Kevin] if(ud->state.running) { - add_timer(ud->canmove_tick, unit_resume_running, bl->id, (int)ud); + add_timer(ud->canmove_tick, unit_resume_running, bl->id, (intptr)ud); } else { |