- Corrected the pet/homunc data not being free'd if the player logs out before being authed.

- Initialized player's speed on pc_setnewpc to prevent homunculus copying a speed of 0.
- Added comment to reloadbattleconf specifying that some settings do not take effect inmediately.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9975 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2007-03-07 18:58:33 +00:00
parent ed7bef2fee
commit e45a007db2
6 changed files with 34 additions and 18 deletions

View File

@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/03/08 2007/03/08
* Corrected the pet/homunc data not being free'd if the player logs out
before being authed.
* Initialized player's speed on pc_setnewpc to prevent homunculus copying a
speed of 0.
* Corrected ranged add-status only triggering if the attack is arrow * Corrected ranged add-status only triggering if the attack is arrow
based. based.
* Updated counter add-status so they trigger on ranged attacks instead of * Updated counter add-status so they trigger on ranged attacks instead of

View File

@ -748,6 +748,8 @@ refreshonline: 99
reloadatcommand: 99 reloadatcommand: 99
// Re-load battle config (admin command) // Re-load battle config (admin command)
// Note that some player config settings won't take effect until relog
// (display exp, display zeny, display skill delay fail, ...)
reloadbattleconf: 99 reloadbattleconf: 99
// Re-load status database (admin command) // Re-load status database (admin command)

View File

@ -1669,6 +1669,8 @@ void map_deliddb(struct block_list *bl) {
int map_quit(struct map_session_data *sd) { int map_quit(struct map_session_data *sd) {
if(!sd->state.auth) { //Removing a player that hasn't even finished loading if(!sd->state.auth) { //Removing a player that hasn't even finished loading
if (sd->pd) unit_free(&sd->pd->bl,-1);
if (sd->hd) unit_free(&sd->hd->bl,-1);
idb_remove(pc_db,sd->status.account_id); idb_remove(pc_db,sd->status.account_id);
idb_remove(charid_db,sd->status.char_id); idb_remove(charid_db,sd->status.char_id);
idb_remove(id_db,sd->bl.id); idb_remove(id_db,sd->bl.id);

View File

@ -358,7 +358,8 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
sd->bl.type = BL_PC; sd->bl.type = BL_PC;
sd->canlog_tick = gettick(); sd->canlog_tick = gettick();
sd->state.waitingdisconnect = 0; sd->state.waitingdisconnect = 0;
//Required to prevent homunculus copuing a base speed of 0.
sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED;
return 0; return 0;
} }

View File

@ -2370,8 +2370,7 @@ int status_calc_homunculus(struct homun_data *hd, int first)
status->rhw.range = 1 + status->size; status->rhw.range = 1 + status->size;
status->mode = MD_CANMOVE|MD_CANATTACK; status->mode = MD_CANMOVE|MD_CANATTACK;
status->speed = DEFAULT_WALK_SPEED; status->speed = DEFAULT_WALK_SPEED;
if (battle_config.hom_setting&0x8 && if (battle_config.hom_setting&0x8 && hd->master)
hd->master && hd->master->state.auth) //Master needs be authed to have valid speed.
status->speed = status_get_speed(&hd->master->bl); status->speed = status_get_speed(&hd->master->bl);
status->hp = 1; status->hp = 1;

View File

@ -1739,6 +1739,8 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
/*========================================== /*==========================================
* Function to free all related resources to the bl * Function to free all related resources to the bl
* if unit is on map, it is removed using the clrtype specified * if unit is on map, it is removed using the clrtype specified
* If clrtype is <0, no saving is performed. This is only for non-authed
* objects that shouldn't be on a map yet.
*------------------------------------------ *------------------------------------------
*/ */
@ -1825,9 +1827,11 @@ int unit_free(struct block_list *bl, int clrtype) {
guild_send_memberinfoshort(sd,0); guild_send_memberinfoshort(sd,0);
pc_cleareventtimer(sd); pc_cleareventtimer(sd);
pc_delspiritball(sd,sd->spiritball,1); pc_delspiritball(sd,sd->spiritball,1);
if (clrtype >= 0) {
chrif_save_scdata(sd); //Save status changes, then clear'em out from memory. [Skotlex] chrif_save_scdata(sd); //Save status changes, then clear'em out from memory. [Skotlex]
pc_makesavestatus(sd); pc_makesavestatus(sd);
pc_clean_skilltree(sd); pc_clean_skilltree(sd);
}
} else if( bl->type == BL_PET ) { } else if( bl->type == BL_PET ) {
struct pet_data *pd = (struct pet_data*)bl; struct pet_data *pd = (struct pet_data*)bl;
struct map_session_data *sd = pd->msd; struct map_session_data *sd = pd->msd;
@ -1870,6 +1874,7 @@ int unit_free(struct block_list *bl, int clrtype) {
aFree (pd->loot); aFree (pd->loot);
pd->loot = NULL; pd->loot = NULL;
} }
if (clrtype >= 0) {
if(pd->pet.intimate > 0) if(pd->pet.intimate > 0)
intif_save_petdata(pd->pet.account_id,&pd->pet); intif_save_petdata(pd->pet.account_id,&pd->pet);
else else
@ -1877,6 +1882,7 @@ int unit_free(struct block_list *bl, int clrtype) {
intif_delete_petdata(pd->pet.pet_id); intif_delete_petdata(pd->pet.pet_id);
if (sd) sd->status.pet_id = 0; if (sd) sd->status.pet_id = 0;
} }
}
if (sd) sd->pd = NULL; if (sd) sd->pd = NULL;
} else if(bl->type == BL_MOB) { } else if(bl->type == BL_MOB) {
struct mob_data *md = (struct mob_data*)bl; struct mob_data *md = (struct mob_data*)bl;
@ -1912,6 +1918,7 @@ int unit_free(struct block_list *bl, int clrtype) {
struct map_session_data *sd = hd->master; struct map_session_data *sd = hd->master;
// Desactive timers // Desactive timers
merc_hom_hungry_timer_delete(hd); merc_hom_hungry_timer_delete(hd);
if (clrtype >= 0) {
if (hd->homunculus.intimacy > 0) if (hd->homunculus.intimacy > 0)
merc_save(hd); merc_save(hd);
else else
@ -1919,6 +1926,7 @@ int unit_free(struct block_list *bl, int clrtype) {
intif_homunculus_requestdelete(hd->homunculus.hom_id); intif_homunculus_requestdelete(hd->homunculus.hom_id);
if (sd) sd->status.hom_id = 0; if (sd) sd->status.hom_id = 0;
} }
}
if(sd) sd->hd = NULL; if(sd) sd->hd = NULL;
} }