summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHoraK-FDF <horak-fdf@web.de>2024-06-07 00:32:54 +0200
committerHoraK-FDF <horak-fdf@web.de>2024-06-07 00:32:54 +0200
commit64cb15b1109d409643fb43d6a5560c36205e29e8 (patch)
treefce41cd205f5047f97673ae5258e7509a86e553a /src/map
parent0b77f0052edf9dd8b22b7026a6509151992dabf1 (diff)
downloadtmwa-64cb15b1109d409643fb43d6a5560c36205e29e8.tar.gz
tmwa-64cb15b1109d409643fb43d6a5560c36205e29e8.tar.bz2
tmwa-64cb15b1109d409643fb43d6a5560c36205e29e8.tar.xz
tmwa-64cb15b1109d409643fb43d6a5560c36205e29e8.zip
activity add sd checking
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index cac3666..b6bce38 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -3870,19 +3870,19 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type)
val = sd ? sd->mute.guild : 0;
break;
case SP::KILLS:
- val = sd->activity.kills;
+ val = sd ? sd->activity.kills : 0;
break;
case SP::CASTS:
- val = sd->activity.casts;
+ val = sd ? sd->activity.casts : 0;
break;
case SP::ITEMS_USED:
- val = sd->activity.items_used;
+ val = sd ? sd->activity.items_used : 0;
break;
case SP::TILES_WALKED:
- val = sd->activity.tiles_walked;
+ val = sd ? sd->activity.tiles_walked : 0;
break;
case SP::ATTACKS:
- val = sd->activity.attacks;
+ val = sd ? sd->activity.attacks : 0;
break;
case SP::AUTOMOD:
val = sd ? static_cast<int>(sd->automod) : 0;
@@ -4135,18 +4135,23 @@ int pc_setparam(dumb_ptr<block_list> bl, SP type, int val)
break;
// atm only setting of casts is needed since magic is handled in serverdata but I let the others here as well for whatever reason
case SP::KILLS:
+ nullpo_retz(sd);
sd->activity.kills = val;
break;
case SP::CASTS:
+ nullpo_retz(sd);
sd->activity.casts = val;
break;
case SP::ITEMS_USED:
+ nullpo_retz(sd);
sd->activity.items_used = val;
break;
case SP::TILES_WALKED:
+ nullpo_retz(sd);
sd->activity.tiles_walked = val;
break;
case SP::ATTACKS:
+ nullpo_retz(sd);
sd->activity.attacks = val;
break;
case SP::AUTOMOD: