From b77ac5278cae8ed970eae7763ace93e9b039a6de Mon Sep 17 00:00:00 2001
From: mekolat <mekolat@gmail.com>
Date: Thu, 16 Apr 2015 21:19:43 -0400
Subject: deprecate builtin readparam & statusup2

---
 src/map/pc.cpp         |  2 +-
 src/map/script-fun.cpp | 41 -----------------------------------------
 2 files changed, 1 insertion(+), 42 deletions(-)

(limited to 'src')

diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 1e840ea..00acadf 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -3547,7 +3547,7 @@ int pc_setparam(dumb_ptr<map_session_data> sd, SP type, int val)
         case SP::INT:
         case SP::DEX:
         case SP::LUK:
-            sd->status.attrs[sp_to_attr(type)] = val;
+            pc_statusup2(sd, type, (val - sd->status.attrs[sp_to_attr(type)]));
             break;
     }
     clif_updatestatus(sd, type);
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 3b814aa..a7f9fcc 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -948,31 +948,6 @@ void builtin_delitem(ScriptState *st)
 
 }
 
-/*==========================================
- *キャラ関係のパラメータ取得
- *------------------------------------------
- */
-static
-void builtin_readparam(ScriptState *st)
-{
-    dumb_ptr<map_session_data> sd;
-
-    SP type = SP(conv_num(st, &AARG(0)));
-    if (HARG(1))
-        sd = map_nick2sd(stringish<CharName>(ZString(conv_str(st, &AARG(1)))));
-    else
-        sd = script_rid2sd(st);
-
-    if (sd == nullptr)
-    {
-        push_int<ScriptDataInt>(st->stack, -1);
-        return;
-    }
-
-    push_int<ScriptDataInt>(st->stack, pc_readparam(sd, type));
-
-}
-
 /*==========================================
  *キャラ関係のID取得
  *------------------------------------------
@@ -1164,20 +1139,6 @@ void builtin_getequipname(ScriptState *st)
 
 }
 
-/*==========================================
- *
- *------------------------------------------
- */
-static
-void builtin_statusup2(ScriptState *st)
-{
-    SP type = SP(conv_num(st, &AARG(0)));
-    int val = conv_num(st, &AARG(1));
-    dumb_ptr<map_session_data> sd = script_rid2sd(st);
-    pc_statusup2(sd, type, val);
-
-}
-
 /*==========================================
  * 装備品による能力値ボーナス
  *------------------------------------------
@@ -3124,12 +3085,10 @@ BuiltinFunction builtin_functions[] =
     BUILTIN(getitem, "Ii??"_s, '\0'),
     BUILTIN(makeitem, "IiMxy"_s, '\0'),
     BUILTIN(delitem, "Ii"_s, '\0'),
-    BUILTIN(readparam, "i?"_s, 'i'),
     BUILTIN(getcharid, "i?"_s, 'i'),
     BUILTIN(strcharinfo, "i"_s, 's'),
     BUILTIN(getequipid, "i"_s, 'i'),
     BUILTIN(getequipname, "i"_s, 's'),
-    BUILTIN(statusup2, "ii"_s, '\0'),
     BUILTIN(bonus, "ii"_s, '\0'),
     BUILTIN(bonus2, "iii"_s, '\0'),
     BUILTIN(skill, "ii?"_s, '\0'),
-- 
cgit v1.2.3-70-g09d2