Skip to content

Commit ac7b454

Browse files
committed
Fix oDancingZombie logic to prevent errors when zombie is not present
1 parent 7a26979 commit ac7b454

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

game/js/CZombie.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,10 +1418,11 @@ var oDancingZombie = InheritO(OrnNoneZombies, {
14181418
g &&
14191419
g.beAttacked &&
14201420
((e.src = "images/Zombies/DancingZombie/Summon2.gif"),
1421-
oSym.addTask(
1421+
oSym.addTask( // zombie existed here
14221422
10,
14231423
(t, s, x) => {
14241424
var h = $Z[t];
1425+
if (!h) return;
14251426
var v = h.ZX;
14261427
var m = h.ArDZ;
14271428
var n = [];
@@ -1432,7 +1433,7 @@ var oDancingZombie = InheritO(OrnNoneZombies, {
14321433
var o = 0;
14331434
var q;
14341435
var l;
1435-
if (h && h.beAttacked) {
1436+
if (h.beAttacked) {
14361437
s.src = "images/Zombies/DancingZombie/Summon3.gif";
14371438
while (r--) {
14381439
(q = m[r]) &&

0 commit comments

Comments
 (0)