Compare commits

...

5 Commits

Author SHA1 Message Date
Aleos
ca73989ae1
Merge branch 'master' into cleanup/removeonchangemap 2022-12-12 14:59:25 -05:00
Aleos
0cd106f9f7
Merge branch 'master' into cleanup/removeonchangemap 2022-05-17 16:48:52 -04:00
aleos
0fce50bc9e Syncs up NoSave flag for several statuses 2022-05-17 12:19:07 -04:00
aleos
5e1fbcbefa Reverts unit_remove_map() static function change
* Reverts unit_remove_map() back to a macro as the preprocessors will point to the static function instead of the calling function.
* Adds third argument to unit_remove_map() macro for changing zone identification.
2022-05-16 15:24:46 -04:00
aleos
d637ecd967 Corrects zone change status removal behavior
* Removes the SCF_REMOVEONCHANGEMAP status flag as statuses with the SCF_NOSAVE flag are removed on zone changes.
* Adds the ability to check for zone changes in unit_remove_map().
* All unit types except for players have their SCF_REMOVEONMAPWARP statuses cleared in unit_remove_map().
* Removes the hardcode for Cloaking and Cloaking Exceed.
2022-05-16 13:15:54 -04:00
14 changed files with 117 additions and 104 deletions

View File

@ -324,10 +324,11 @@ Body:
OnTouch: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
NoSave: true
EndOnStart:
Closeconfine: true
Closeconfine2: true
@ -589,7 +590,7 @@ Body:
RemoveOnDamaged: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
EndOnStart:
Dancing: true
- Status: Loud
@ -731,7 +732,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
MinDuration: 5000
- Status: Keeping
DurationLookup: NPC_KEEPING
@ -963,7 +965,8 @@ Body:
States:
NoMove: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Bladestop
Icon: EFST_BLADESTOP
DurationLookup: MO_BLADESTOP
@ -980,7 +983,7 @@ Body:
NoClearbuff: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Fireweapon
Icon: EFST_PROPERTYFIRE
DurationLookup: SA_FLAMELAUNCHER
@ -1193,7 +1196,7 @@ Body:
Flags:
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Guildaura
Flags:
NoDispell: true
@ -1285,10 +1288,11 @@ Body:
OnTouch: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
NoSave: true
- Status: Rejectsword
Icon: EFST_SWORDREJECT
DurationLookup: ST_REJECTSWORD
@ -1305,7 +1309,8 @@ Body:
Opt3:
Marionette: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Marionette: true
- Status: Marionette2
@ -1321,7 +1326,8 @@ Body:
Opt3:
Marionette: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Marionette2: true
- Status: Changeundead
@ -1395,7 +1401,7 @@ Body:
DurationLookup: CR_DEVOTION
Flags:
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
OverlapIgnoreLevel: true
EndOnEnd:
Autoguard: true
@ -1479,7 +1485,7 @@ Body:
Flags:
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Shadowweapon
Icon: EFST_PROPERTYDARK
DurationLookup: TK_SEVENWIND
@ -1657,7 +1663,7 @@ Body:
NoClearance: true
NoSave: true
NoRemoveOnDead: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Closeconfine2
Icon: EFST_RG_CCONFINE_S
DurationLookup: RG_CLOSECONFINE
@ -1670,7 +1676,7 @@ Body:
NoClearance: true
NoSave: true
NoRemoveOnDead: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Fail:
Closeconfine2: true
- Status: Dancing
@ -1687,9 +1693,10 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
RequireWeapon: true
OverlapIgnoreLevel: true
NoSave: true
EndOnEnd:
Longing: true
- Status: Elementalchange
@ -1853,7 +1860,7 @@ Body:
StopWalking: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Debuff: true
- Status: Spurt
Icon: EFST_STRUP
@ -2169,8 +2176,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Sun_Comfort
Icon: EFST_SUN_COMFORT
DurationLookup: SG_SUN_COMFORT
@ -2178,6 +2185,7 @@ Body:
Def2: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Moon_Comfort
Icon: EFST_MOON_COMFORT
DurationLookup: SG_MOON_COMFORT
@ -2185,6 +2193,7 @@ Body:
Flee: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Star_Comfort
Icon: EFST_STAR_COMFORT
DurationLookup: SG_STAR_COMFORT
@ -2192,6 +2201,7 @@ Body:
Aspd: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Fusion
DurationLookup: SG_FUSION
CalcFlags:
@ -2387,7 +2397,8 @@ Body:
Vit: true
Int: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Change: true
- Status: Bloodlust
@ -3198,7 +3209,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Bite
Icon: EFST_WUGBITE
DurationLookup: RA_WUGBITE
@ -3230,7 +3241,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Acceleration
Icon: EFST_ACCELERATION
DurationLookup: NC_ACCELERATION
@ -3312,7 +3323,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Stealthfield
Icon: EFST_STEALTHFIELD
DurationLookup: NC_STEALTHFIELD
@ -3335,7 +3346,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Overheat
Icon: EFST_OVERHEAT
Flags:
@ -3744,7 +3755,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Debuff: true
Fail:
Hallucinationwalk: true
@ -4131,7 +4142,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
StopAttacking: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Cursedcircle_Target
Icon: EFST_CURSEDCIRCLE_TARGET
DurationLookup: SR_CURSEDCIRCLE
@ -4473,7 +4484,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: _Bodypaint
Icon: EFST_BODYPAINT
DurationLookup: SC_BODYPAINT
@ -4607,7 +4618,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: _Bloodylust
Icon: EFST_BLOODYLUST
DurationLookup: SC_BLOODYLUST
@ -5201,7 +5213,7 @@ Body:
Flags:
StopWalking: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Tinder_Breaker2
Icon: EFST_TINDER_BREAKER
DurationLookup: MH_TINDER_BREAKER
@ -5212,7 +5224,7 @@ Body:
Flags:
StopWalking: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Cbc
Icon: EFST_CBC
DurationLookup: MH_CBC
@ -5746,7 +5758,7 @@ Body:
Flags:
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
- Status: Mtf_Aspd2
@ -6051,7 +6063,6 @@ Body:
Flags:
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Su_Stoop
Icon: EFST_SU_STOOP
@ -6617,7 +6628,8 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoClearbuff: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Entry_Queue_Apply_Delay
Icon: EFST_ENTRY_QUEUE_APPLY_DELAY
Flags:
@ -6689,7 +6701,7 @@ Body:
Icon: EFST_FLASHKICK
DurationLookup: SJ_FLASHKICK
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
@ -6706,7 +6718,7 @@ Body:
NoClearance: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Fail:
Bite: true
- Status: Starstance

View File

@ -335,10 +335,11 @@ Body:
OnTouch: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
NoSave: true
EndOnStart:
Closeconfine: true
Closeconfine2: true
@ -604,7 +605,7 @@ Body:
RemoveOnDamaged: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
EndOnStart:
Dancing: true
- Status: Loud
@ -748,7 +749,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
MinDuration: 5000
- Status: Keeping
DurationLookup: NPC_KEEPING
@ -980,7 +982,8 @@ Body:
States:
NoMove: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Bladestop
Icon: EFST_BLADESTOP
DurationLookup: MO_BLADESTOP
@ -997,7 +1000,7 @@ Body:
NoClearbuff: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Fireweapon
Icon: EFST_PROPERTYFIRE
DurationLookup: SA_FLAMELAUNCHER
@ -1301,7 +1304,7 @@ Body:
OnTouch: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
@ -1321,7 +1324,8 @@ Body:
Opt3:
Marionette: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Marionette: true
- Status: Marionette2
@ -1337,7 +1341,8 @@ Body:
Opt3:
Marionette: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Marionette2: true
- Status: Changeundead
@ -1411,7 +1416,7 @@ Body:
DurationLookup: CR_DEVOTION
Flags:
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
OverlapIgnoreLevel: true
EndOnEnd:
Autoguard: true
@ -1495,7 +1500,7 @@ Body:
Flags:
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Shadowweapon
Icon: EFST_PROPERTYDARK
DurationLookup: TK_SEVENWIND
@ -1654,7 +1659,7 @@ Body:
NoClearance: true
NoSave: true
NoRemoveOnDead: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Closeconfine2
Icon: EFST_RG_CCONFINE_S
DurationLookup: RG_CLOSECONFINE
@ -1667,7 +1672,7 @@ Body:
NoClearance: true
NoSave: true
NoRemoveOnDead: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Fail:
Closeconfine2: true
- Status: Dancing
@ -1684,9 +1689,10 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
RequireWeapon: true
OverlapIgnoreLevel: true
NoSave: true
EndOnEnd:
EnsembleFatigue: true
- Status: Elementalchange
@ -1962,7 +1968,7 @@ Body:
StopWalking: true
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Debuff: true
- Status: Spurt
Icon: EFST_STRUP
@ -2283,8 +2289,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Sun_Comfort
Icon: EFST_SUN_COMFORT
DurationLookup: SG_SUN_COMFORT
@ -2292,6 +2298,7 @@ Body:
Def2: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Moon_Comfort
Icon: EFST_MOON_COMFORT
DurationLookup: SG_MOON_COMFORT
@ -2299,6 +2306,7 @@ Body:
Flee: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Star_Comfort
Icon: EFST_STAR_COMFORT
DurationLookup: SG_STAR_COMFORT
@ -2306,6 +2314,7 @@ Body:
Aspd: true
Flags:
RemoveOnMapWarp: true
NoSave: true
- Status: Fusion
DurationLookup: SG_FUSION
CalcFlags:
@ -2499,7 +2508,8 @@ Body:
Vit: true
Int: true
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
Fail:
Change: true
- Status: Bloodlust
@ -3322,7 +3332,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Bite
Icon: EFST_WUGBITE
DurationLookup: RA_WUGBITE
@ -3354,7 +3364,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Acceleration
Icon: EFST_ACCELERATION
DurationLookup: NC_ACCELERATION
@ -3441,7 +3451,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Stealthfield
Icon: EFST_STEALTHFIELD
DurationLookup: NC_STEALTHFIELD
@ -3465,7 +3475,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Overheat
Icon: EFST_OVERHEAT
Flags:
@ -3904,7 +3914,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Debuff: true
Fail:
Hallucinationwalk: true
@ -4299,7 +4309,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
StopAttacking: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
SendVal3: true
- Status: Cursedcircle_Target
Icon: EFST_CURSEDCIRCLE_TARGET
@ -4647,7 +4657,7 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
SendVal3: true
- Status: _Bodypaint
Icon: EFST_BODYPAINT
@ -4798,7 +4808,8 @@ Body:
NoDispell: true
NoBanishingBuster: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: _Bloodylust
Icon: EFST_BLOODYLUST
DurationLookup: SC_BLOODYLUST
@ -5471,7 +5482,7 @@ Body:
Flee: true
Flags:
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Tinder_Breaker2
Icon: EFST_TINDER_BREAKER
DurationLookup: MH_TINDER_BREAKER
@ -5479,7 +5490,7 @@ Body:
Flee: true
Flags:
NoSave: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Fail:
Tinder_Breaker2: true
- Status: Cbc
@ -6019,7 +6030,7 @@ Body:
Flags:
NoSave: true
NoClearance: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
- Status: Extremityfist2
@ -6358,7 +6369,6 @@ Body:
Flags:
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
- Status: Su_Stoop
Icon: EFST_SU_STOOP
@ -6950,7 +6960,8 @@ Body:
NoBanishingBuster: true
NoClearance: true
NoClearbuff: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoSave: true
- Status: Entry_Queue_Apply_Delay
Icon: EFST_ENTRY_QUEUE_APPLY_DELAY
Flags:
@ -7034,7 +7045,7 @@ Body:
Icon: EFST_FLASHKICK
DurationLookup: SJ_FLASHKICK
Flags:
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true
@ -7053,7 +7064,7 @@ Body:
NoClearance: true
StopAttacking: true
RemoveOnDamaged: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
Fail:
Bite: true
- Status: Starstance
@ -7618,7 +7629,7 @@ Body:
BlEffect: true
DisplayPc: true
OverlapIgnoreLevel: true
RemoveOnChangeMap: true
RemoveOnMapWarp: true
NoBanishingBuster: true
NoDispell: true
NoClearance: true

View File

@ -226,7 +226,6 @@ Flags: Various status flags for specific status change events.
RemoveOnRefresh - Removed by RK_REFRESH.
RemoveOnLuxAnima - Removed by RK_LUXANIMA.
RemoveOnMapWarp - Removed when warping to another map.
RemoveOnChangeMap - Removed when changing map-server.
RemoveChemicalProtect - Removed by AM_CP_ARMOR/AM_CP_HELM/AM_CP_SHIELD/AM_CP_WEAPON.
RemoveElementalOption - Removed by elemental changing modes/quitting/EL_TIDAL_WEAPON/EL_WATER_SCREEN on the master and elemental.
RemoveOnUnequip - Removed when unequipping any type of equipment.

View File

@ -209,7 +209,7 @@ int elemental_delete(s_elemental_data *ed) {
sd->ed = NULL;
sd->status.ele_id = 0;
return unit_remove_map(&ed->bl, CLR_OUTSIGHT);
return unit_remove_map(&ed->bl, CLR_OUTSIGHT, false);
}
void elemental_summon_init(s_elemental_data *ed) {

View File

@ -313,7 +313,7 @@ int hom_vaporize(struct map_session_data *sd, int flag)
status_change_end(&sd->bl, SC_HOMUN_TIME);
#endif
return unit_remove_map(&hd->bl, CLR_OUTSIGHT);
return unit_remove_map(&hd->bl, CLR_OUTSIGHT, false);
}
/**
@ -339,7 +339,7 @@ int hom_delete(struct homun_data *hd, int emote)
// Send homunculus_dead to client
hd->homunculus.hp = 0;
clif_hominfo(sd, hd, 0);
return unit_remove_map(&hd->bl,CLR_OUTSIGHT);
return unit_remove_map(&hd->bl,CLR_OUTSIGHT, false);
}
/**
@ -660,7 +660,7 @@ int hom_evolution(struct homun_data *hd)
hom->luk += 10*rnd_value(min->luk, max->luk);
hom->intimacy = battle_config.homunculus_evo_intimacy_reset;
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
unit_remove_map(&hd->bl, CLR_OUTSIGHT, false);
if (map_addblock(&hd->bl))
return 0;
@ -711,7 +711,7 @@ int hom_mutate(struct homun_data *hd, int homun_id)
return 0;
}
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
unit_remove_map(&hd->bl, CLR_OUTSIGHT, false);
if(map_addblock(&hd->bl))
return 0;

View File

@ -291,7 +291,7 @@ int mercenary_delete(s_mercenary_data *md, int reply) {
}
clif_mercenary_message(sd, reply);
return unit_remove_map(&md->bl, CLR_OUTSIGHT);
return unit_remove_map(&md->bl, CLR_OUTSIGHT, false);
}
/**

View File

@ -1105,7 +1105,7 @@ int mob_spawn (struct mob_data *md)
md->last_thinktime = tick;
if (md->bl.prev != NULL)
unit_remove_map(&md->bl,CLR_RESPAWN);
unit_remove_map(&md->bl,CLR_RESPAWN, false);
else
if (md->spawn && md->mob_id != md->spawn->id)
{
@ -6696,7 +6696,7 @@ void mob_reload_itemmob_data(void) {
static int mob_reload_sub( struct mob_data *md, va_list args ){
// Slaves have to be killed
if( md->master_id != 0 ){
unit_remove_map( &md->bl, CLR_OUTSIGHT );
unit_remove_map( &md->bl, CLR_OUTSIGHT, false);
return 0;
}
@ -6709,7 +6709,7 @@ static int mob_reload_sub( struct mob_data *md, va_list args ){
ShowDebug( "mob_reload_sub: The monster was removed from map %s (%hu/%hu).\n", map_mapid2mapname( md->bl.m ), md->bl.x, md->bl.y );
}
unit_remove_map( &md->bl, CLR_OUTSIGHT );
unit_remove_map( &md->bl, CLR_OUTSIGHT, false);
return 0;
}

View File

@ -6774,7 +6774,7 @@ enum e_setpos pc_setpos(struct map_session_data* sd, unsigned short mapindex, in
npc_script_event(sd, NPCE_LOGOUT);
//remove from map, THEN change x/y coordinates
unit_remove_map_pc(sd,clrtype);
unit_remove_map_pc(sd,clrtype,true);
sd->mapindex = mapindex;
sd->bl.x=x;
sd->bl.y=y;

View File

@ -1316,7 +1316,7 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
if(rnd()%10000 < pet_catch_rate) {
achievement_update_objective(sd, AG_TAMING, 1, md->mob_id);
unit_remove_map(&md->bl,CLR_OUTSIGHT);
unit_remove_map(&md->bl,CLR_OUTSIGHT, false);
status_kill(&md->bl);
clif_pet_roulette(sd,1);
@ -2299,7 +2299,7 @@ void pet_evolution(struct map_session_data *sd, int16 pet_id) {
clif_additem(sd, idx, 1, 0);
// Remove the old pet from sight
unit_remove_map(&sd->pd->bl, CLR_OUTSIGHT);
unit_remove_map(&sd->pd->bl, CLR_OUTSIGHT, false);
// Prepare the new pet
sd->pd->pet.class_ = pet_id;

View File

@ -9787,7 +9787,6 @@
export_constant(SCF_SETSTAND);
export_constant(SCF_FAILEDMADO);
export_constant(SCF_DEBUFF);
export_constant(SCF_REMOVEONCHANGEMAP);
export_constant(SCF_REMOVEONMAPWARP);
export_constant(SCF_REMOVECHEMICALPROTECT);
export_constant(SCF_OVERLAPIGNORELEVEL);

View File

@ -1603,7 +1603,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 dhp, in
if(flag&4) // Delete from memory. (also invokes map removal code)
unit_free(target,CLR_DEAD);
else if(flag&2) // remove from map
unit_remove_map(target,CLR_DEAD);
unit_remove_map(target,CLR_DEAD, false);
else { // Some death states that would normally be handled by unit_remove_map
unit_stop_attack(target);
unit_stop_walking(target,1);

View File

@ -2908,7 +2908,6 @@ enum e_status_change_flag : uint16 {
SCF_SETSTAND,
SCF_FAILEDMADO,
SCF_DEBUFF,
SCF_REMOVEONCHANGEMAP,
SCF_REMOVEONMAPWARP,
SCF_REMOVECHEMICALPROTECT,
SCF_OVERLAPIGNORELEVEL,

View File

@ -1335,7 +1335,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
if (bl->type == BL_PC) // Use pc_setpos
return pc_setpos((TBL_PC*)bl, map_id2index(m), x, y, type);
if (!unit_remove_map(bl, type))
if (!unit_remove_map(bl, type, false))
return 3;
if (bl->m != m && battle_config.clear_unit_onwarp &&
@ -3036,7 +3036,7 @@ int unit_changetarget(struct block_list *bl, va_list ap) {
* @param file, line, func: Call information for debug purposes
* @return Success(1); Couldn't be removed or bl was free'd(0)
*/
int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func)
int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func, bool changeZone)
{
struct unit_data *ud = unit_bl2ud(bl);
struct status_change *sc = status_get_sc(bl);
@ -3069,13 +3069,12 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
ud->attackabletime = ud->canmove_tick /*= ud->canact_tick*/ = gettick();
if(sc && sc->count ) { // map-change/warp dispells.
status_db.removeByStatusFlag(bl, { SCF_REMOVEONCHANGEMAP });
if (changeZone) // Zone change calls the general NoSave statuses.
status_db.removeByStatusFlag(bl, { SCF_NOSAVE });
if (bl->type != BL_PC) // Players are cleared in pc_setpos.
status_db.removeByStatusFlag(bl, { SCF_REMOVEONMAPWARP });
// Ensure the bl is a PC; if so, we'll handle the removal of cloaking and cloaking exceed later
if ( bl->type != BL_PC ) {
status_change_end(bl, SC_CLOAKING);
status_change_end(bl, SC_CLOAKINGEXCEED);
}
if (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF)
status_change_end(bl, SC_GOSPEL);
if (sc->data[SC_PROVOKE] && sc->data[SC_PROVOKE]->val4 == 1)
@ -3128,12 +3127,6 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
if( !sd->npc_ontouch_.empty() )
npc_touchnext_areanpc(sd,true);
// Check if warping and not changing the map.
if ( sd->state.warping && !sd->state.changemap ) {
status_change_end(bl, SC_CLOAKING);
status_change_end(bl, SC_CLOAKINGEXCEED);
}
sd->npc_shopid = 0;
sd->adopt_invite = 0;
@ -3323,25 +3316,25 @@ void unit_refresh(struct block_list *bl, bool walking) {
* 0: Assume bl is being warped
* 1: Death, appropriate cleanup performed
*/
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype)
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype, bool changeZone)
{
unit_remove_map(&sd->bl,clrtype);
unit_remove_map(&sd->bl,clrtype, changeZone);
//CLR_RESPAWN is the warp from logging out, CLR_TELEPORT is the warp from teleporting, but pets/homunc need to just 'vanish' instead of showing the warping animation.
if (clrtype == CLR_RESPAWN || clrtype == CLR_TELEPORT)
clrtype = CLR_OUTSIGHT;
if(sd->pd)
unit_remove_map(&sd->pd->bl, clrtype);
unit_remove_map(&sd->pd->bl, clrtype, changeZone);
if(hom_is_active(sd->hd))
unit_remove_map(&sd->hd->bl, clrtype);
unit_remove_map(&sd->hd->bl, clrtype, changeZone);
if(sd->md)
unit_remove_map(&sd->md->bl, clrtype);
unit_remove_map(&sd->md->bl, clrtype, changeZone);
if(sd->ed)
unit_remove_map(&sd->ed->bl, clrtype);
unit_remove_map(&sd->ed->bl, clrtype, changeZone);
}
/**
@ -3383,7 +3376,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
map_freeblock_lock();
if( bl->prev ) // Players are supposed to logout with a "warp" effect.
unit_remove_map(bl, clrtype);
unit_remove_map(bl, clrtype, false);
switch( bl->type ) {
case BL_PC: {

View File

@ -165,11 +165,11 @@ void unit_skillunit_maxcount(unit_data& ud, uint16 skill_id, int& maxcount);
// Remove unit
struct unit_data* unit_bl2ud(struct block_list *bl);
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype);
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype, bool changeZone = false);
void unit_refresh(struct block_list *bl, bool walking = false);
void unit_free_pc(struct map_session_data *sd);
#define unit_remove_map(bl,clrtype) unit_remove_map_(bl,clrtype,__FILE__,__LINE__,__func__)
int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func);
#define unit_remove_map(bl,clrtype,changeZone) unit_remove_map_(bl,clrtype,__FILE__,__LINE__,__func__,changeZone)
int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func, bool changeZone = false);
int unit_free(struct block_list *bl, clr_type clrtype);
int unit_changeviewsize(struct block_list *bl,short size);
int unit_changetarget(struct block_list *bl,va_list ap);