From 5ea15b37b25106a228c5ede264bd5424b1291507 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Jun 2019 21:39:31 +0300 Subject: Update from hercules --- src/emap/script_buildins.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 5135874..34d8f54 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -1282,7 +1282,8 @@ BUILDIN(failedRemoveCardsIndex) if (sd->status.inventory[i].card[c] && itemdb_type(sd->status.inventory[i].card[c]) == IT_CARD) { cardflag = 1; - sd->status.inventory[i].card[c] = 0; + if (typefail == 1) + sd->status.inventory[i].card[c] = 0; if (typefail == 2) { // add cards to inventory, clear @@ -1468,6 +1469,12 @@ BUILDIN(npcWalkTo) if (nd) { unit->bl2ud2(&nd->bl); // ensure nd->ud is safe to edit + if (nd->ud == NULL) + { + ShowWarning("buildin_npcwalkto: floating NPC don't have unit data.\n"); + return false; + } + if (!nd->status.hp) { status_calc_npc(nd, SCO_FIRST); @@ -1477,7 +1484,7 @@ BUILDIN(npcWalkTo) status_calc_npc(nd, SCO_NONE); } nd->vd.dead_sit = 0; - script_pushint(st, unit->walktoxy(&nd->bl,x,y,0)); + script_pushint(st, unit->walktoxy(&nd->bl, x, y, 0)); return true; } else -- cgit v1.2.3-60-g2f50