summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-06-26 21:39:31 +0300
committerAndrei Karas <akaras@inbox.ru>2019-06-26 21:39:31 +0300
commit5ea15b37b25106a228c5ede264bd5424b1291507 (patch)
treef07fc6e24be170cba3be1b7375e3d7dddf76baaa
parent4d6327d1f40e86fc0524545700c928e3434cfc0e (diff)
downloadevol-hercules-5ea15b37b25106a228c5ede264bd5424b1291507.tar.gz
evol-hercules-5ea15b37b25106a228c5ede264bd5424b1291507.tar.bz2
evol-hercules-5ea15b37b25106a228c5ede264bd5424b1291507.tar.xz
evol-hercules-5ea15b37b25106a228c5ede264bd5424b1291507.zip
Update from herculess20190819
-rw-r--r--src/emap/script_buildins.c11
1 files 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