diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-06-26 21:39:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-06-26 21:39:31 +0300 |
commit | 5ea15b37b25106a228c5ede264bd5424b1291507 (patch) | |
tree | f07fc6e24be170cba3be1b7375e3d7dddf76baaa | |
parent | 4d6327d1f40e86fc0524545700c928e3434cfc0e (diff) | |
download | plugin-s20190819.tar.gz plugin-s20190819.tar.bz2 plugin-s20190819.tar.xz plugin-s20190819.zip |
Update from herculess20190819
-rw-r--r-- | src/emap/script_buildins.c | 11 |
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 |