summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-26 14:03:41 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-26 14:03:41 +0000
commitbcb429dd6c87d5069b8c0b4c4c8f18f05303380f (patch)
treebab0b342329c4d1d0ac614b398d83fa0babb708b /src/map
parent6abf2948ef3d1d303013d5a1a0dc29e346a4965a (diff)
downloadhercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.gz
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.bz2
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.xz
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.zip
Changed 'killerrid' and 'killedrid' from player vars to player params (bugreport:3249).
Now stored in player session data, so they don't get saved on logout anymore. Added sql upgrade script 'upgrade_svn14507.sql' to remove the now unused player variables. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14507 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mob.c6
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/pc.h2
4 files changed, 17 insertions, 5 deletions
diff --git a/src/map/map.h b/src/map/map.h
index 9f25249e2..08cb3aada 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -296,6 +296,8 @@ enum _sp {
SP_BASEJOB=119, // 100+19 - celest
SP_BASECLASS=120, //Hmm.. why 100+19? I just use the next one... [Skotlex]
+ SP_KILLERRID=121,
+ SP_KILLEDRID=122,
// Mercenaries
SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190,
diff --git a/src/map/mob.c b/src/map/mob.c
index 413d88f26..15e27b686 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2406,12 +2406,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
{
if( sd && battle_config.mob_npc_event_type )
{
- pc_setglobalreg(sd,"killerrid",sd->bl.id);
+ pc_setparam(sd, SP_KILLERRID, sd->bl.id);
npc_event(sd,md->npc_event,0);
}
else if( mvp_sd )
{
- pc_setglobalreg(mvp_sd,"killerrid",sd?sd->bl.id:0);
+ pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
}
else
@@ -2419,7 +2419,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
else if( mvp_sd && !md->state.npc_killmonster )
{
- pc_setglobalreg(mvp_sd,"killedrid",md->class_);
+ pc_setparam(mvp_sd, SP_KILLEDRID, md->class_);
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 28ead8086..27ebf2e36 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5613,7 +5613,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
}
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
- pc_setglobalreg(sd,"killerrid",src?src->id:0);
+ pc_setparam(sd, SP_KILLERRID, src?src->id:0);
if( sd->state.bg_id )
{
struct battleground_data *bg;
@@ -5667,7 +5667,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (src && src->type == BL_PC)
{
struct map_session_data *ssd = (struct map_session_data *)src;
- pc_setglobalreg(ssd, "killedrid", sd->bl.id);
+ pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
npc_script_event(ssd, NPCE_KILLPC);
if (battle_config.pk_mode&2) {
@@ -5923,6 +5923,8 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_KARMA: val = sd->status.karma; break;
case SP_MANNER: val = sd->status.manner; break;
case SP_FAME: val = sd->status.fame; break;
+ case SP_KILLERRID: val = sd->killerrid; break;
+ case SP_KILLEDRID: val = sd->killedrid; break;
}
return val;
@@ -6043,6 +6045,12 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
case SP_FAME:
sd->status.fame = val;
break;
+ case SP_KILLERRID:
+ sd->killerrid = val;
+ return 1;
+ case SP_KILLEDRID:
+ sd->killedrid = val;
+ return 1;
default:
ShowError("pc_setparam: Attempted to set unknown parameter '%d'.\n", type);
return 0;
diff --git a/src/map/pc.h b/src/map/pc.h
index 7bf3a050f..9c9408da6 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -378,6 +378,8 @@ struct map_session_data {
int duel_group; // duel vars [LuzZza]
int duel_invite;
+ int killerrid, killedrid;
+
char away_message[128]; // [LuzZza]
int cashPoints, kafraPoints;