diff options
-rw-r--r-- | src/map/script-fun.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index c471da1..5982624 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -3111,6 +3111,7 @@ void builtin_summon(ScriptState *st) if (mob) { mob->mode = get_mob_db(monster_id).mode; + push_int<ScriptDataInt>(st->stack, unwrap<BlockId>(mob->bl_id)); // Return mob GID to caller switch (monster_attitude) { @@ -3150,6 +3151,10 @@ void builtin_summon(ScriptState *st) mob->master_dist = 6; } } + else // got no (mob), default + { + push_int<ScriptDataInt>(st->stack, 0); + } } /*========================================== @@ -5687,7 +5692,7 @@ BuiltinFunction builtin_functions[] = BUILTIN(mobinfo, "ii"_s, 'v'), BUILTIN(mobinfo_droparrays, "iiN"_s, 'i'), BUILTIN(getmobdrops, "i"_s, 'i'), - BUILTIN(summon, "Mxyssmii?"_s, '\0'), + BUILTIN(summon, "Mxyssmii?"_s, 'i'), BUILTIN(monster, "Mxysmi?"_s, '\0'), BUILTIN(areamonster, "Mxyxysmi?"_s, '\0'), BUILTIN(killmonster, "ME"_s, '\0'), |