summaryrefslogtreecommitdiff
path: root/src/map/pc.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-10-14 15:58:59 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-15 11:46:55 -0400
commit3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1 (patch)
tree158d45edd852a733bfc125a4dd324de98b934334 /src/map/pc.cpp
parent0fd54ac797cea996ba3430168b4a962df13c12fa (diff)
downloadtmwa-3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1.tar.gz
tmwa-3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1.tar.bz2
tmwa-3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1.tar.xz
tmwa-3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1.zip
add more params, allow get/set to use char id
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r--src/map/pc.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 1440454..0f6c9a6 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -3522,6 +3522,12 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type)
case SP::BL_TYPE:
val = static_cast<uint8_t>(bl->bl_type);
break;
+ case SP::PARTNER:
+ val = sd ? unwrap<CharId>(sd->status.partner_id) : 0;
+ break;
+ case SP::CHAR_ID:
+ val = sd ? unwrap<CharId>(sd->status_key.char_id) : 0;
+ break;
}
return val;
@@ -3663,6 +3669,21 @@ int pc_setparam(dumb_ptr<map_session_data> sd, SP type, int val)
case SP::LUK:
pc_statusup2(sd, type, (val - sd->status.attrs[sp_to_attr(type)]));
break;
+ case SP::PARTNER:
+ dumb_ptr<block_list> p_bl;
+ if (val < 2000000 && val >= 150000)
+ {
+ dumb_ptr<map_session_data> p_sd = nullptr;
+ if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(val)))) != nullptr)
+ p_bl = map_id2bl(p_sd->bl_id);
+ }
+ else
+ p_bl = map_id2bl(wrap<BlockId>(val));
+ if (val < 1)
+ pc_divorce(sd);
+ else
+ p_bl ? pc_marriage(sd, p_bl->is_player()) : 0;
+ break;
}
clif_updatestatus(sd, type);