summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 21:12:45 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-15 21:12:45 +0000
commit9a309db58c70c994d7f937a243b52fe27a6c1f1d (patch)
treee3e40a7c60acb6a17687505da4197a77f355e1bf /src/map/unit.c
parent4aacac823607e804583d401bc2e27e7ca94865b6 (diff)
downloadhercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.gz
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.bz2
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.tar.xz
hercules-9a309db58c70c994d7f937a243b52fe27a6c1f1d.zip
- Cleaned up some of the pet related @/# commands, same for some script commands.
- Moved s_pet structure from map_session_data to pet_data, this enabled the removal of a few redundant values in the pet_data structure (name, class, equip) - Pet offensive skills who's inf value is self will be casted on the pet now (for stuff like Grand Cross) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8301 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 7d4af0dfb..b70c88a97 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -443,7 +443,7 @@ int unit_movepos(struct block_list *bl,int dst_x,int dst_y, int easy, int checkp
return 0;
} else
sd->areanpc_id=0;
- if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0)
+ if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0)
{ //Check if pet needs to be teleported. [Skotlex]
int flag = 0;
bl = &sd->pd->bl; //Note that bl now points to the pet!
@@ -1585,9 +1585,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
md->state.skillstate= MSS_IDLE;
} else if (bl->type == BL_PET) {
struct pet_data *pd = (struct pet_data*)bl;
- struct map_session_data *sd = pd->msd;
-
- if(!sd || sd->pet.intimate <= 0) {
+ if(pd->pet.intimate <= 0) {
clif_clearchar_area(bl,clrtype);
map_delblock(bl);
unit_free(bl);
@@ -1738,16 +1736,14 @@ int unit_free(struct block_list *bl) {
aFree (pd->loot);
pd->loot = NULL;
}
- if (sd) {
- sd->pd = NULL;
- if(sd->pet.intimate > 0)
- intif_save_petdata(sd->status.account_id,&sd->pet);
- else
- { //Remove pet.
- intif_delete_petdata(sd->status.pet_id);
- sd->status.pet_id = 0;
- }
+ if(pd->pet.intimate > 0)
+ intif_save_petdata(pd->pet.account_id,&pd->pet);
+ else
+ { //Remove pet.
+ intif_delete_petdata(pd->pet.pet_id);
+ if (sd) sd->status.pet_id = 0;
}
+ if (sd) sd->pd = NULL;
} else if(bl->type == BL_MOB) {
struct mob_data *md = (struct mob_data*)bl;
if(md->deletetimer!=-1) {