summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-01-23 17:27:24 +0100
committerFedja Beader <fedja@protonmail.ch>2025-01-23 17:28:39 +0100
commitd8782a82fc0cbc6b52d2f7385229cbe832562b95 (patch)
treef3c1895c1bb98d49424911ba9d85c7ada9d7bd5f
parent7076320f98a9044e73a873c6f5bd7aa51c795c0c (diff)
downloadtmwa-d8782a82fc0cbc6b52d2f7385229cbe832562b95.tar.gz
tmwa-d8782a82fc0cbc6b52d2f7385229cbe832562b95.tar.bz2
tmwa-d8782a82fc0cbc6b52d2f7385229cbe832562b95.tar.xz
tmwa-d8782a82fc0cbc6b52d2f7385229cbe832562b95.zip
Apply bjorn's suggestion (number of accesses MaxDrops->1)
-rw-r--r--src/map/script-fun.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index de4525b..feaf388 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -3099,9 +3099,10 @@ void builtin_getmobdrops(ScriptState *st)
status = 1;
+ const mob_db_& mob_info = get_mob_db(mob_id);
for (; i < MaxDrops; ++i)
{
- auto& dropitem = get_mob_db(mob_id).dropitem[i];
+ auto& dropitem = mob_info.dropitem[i];
if (dropitem.nameid)
{
set_reg(bl, VariableCode::VARIABLE, SIR::from(variable_names.intern("$@MobDrop_item"_s), i), dropitem.p.num);