From: Rick Bird Date: Sun, 27 Mar 2011 05:24:37 +0000 (-0400) Subject: 182p8 - * Crash bug when too many objects are nested. Reported by Paige, fixed by... X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=d8a46790366a058e2e10db035cd91e9007da3799;p=cobramush.git 182p8 - * Crash bug when too many objects are nested. Reported by Paige, fixed by Javelin and Intervis. --- diff --git a/src/move.c b/src/move.c index a5db883..a1a2dae 100644 --- a/src/move.c +++ b/src/move.c @@ -100,9 +100,10 @@ moveit(dbref what, dbref where, int nomovemsgs) /* If the player is leaving a zone, do zone messages */ /* The tricky bit here is that we only care about the zone of * the outermost contents */ - if (GoodObject(absold) && GoodObject(Zone(absold)) - && (Zone(absloc) != Zone(absold))) - did_it_interact(what, Zone(absold), "ZLEAVE", NULL, "OZLEAVE", NULL, + if (GoodObject(absloc) && GoodObject(Zone(absloc)) && + (!GoodObject(absold) || !GoodObject(Zone(absold)) || + (Zone(absloc) != Zone(absold)))) + did_it_interact(what, Zone(absold), "ZLEAVE", NULL, "OZLEAVE", NULL, "AZLEAVE", old, NA_INTER_SEE); if (GoodObject(old) && !IsRoom(old)) did_it_interact(what, old, NULL, NULL, "OXLEAVE", NULL, NULL, where, @@ -111,20 +112,23 @@ moveit(dbref what, dbref where, int nomovemsgs) did_it_interact(what, where, NULL, NULL, "OXENTER", NULL, NULL, old, NA_INTER_SEE); /* If the player is entering a new zone, do zone messages */ - if (!GoodObject(absold) - || (GoodObject(Zone(absloc)) && (Zone(absloc) != Zone(absold)))) + if (GoodObject(absloc) && GoodObject(Zone(absloc)) && + (!GoodObject(absold) || !GoodObject(Zone(absold)) || + (Zone(absloc) != Zone(absold)))) did_it_interact(what, Zone(absloc), "ZENTER", NULL, "OZENTER", NULL, - "AZENTER", where, NA_INTER_SEE); + "AZENTER", where, NA_INTER_SEE); did_it_interact(what, where, "ENTER", NULL, "OENTER", T("has arrived."), "AENTER", where, NA_INTER_PRESENCE); } else { /* non-listeners only trigger the actions not the messages */ did_it(what, old, NULL, NULL, NULL, NULL, "ALEAVE", old); - if (GoodObject(absold) && GoodObject(Zone(absold)) - && (Zone(absloc) != Zone(absold))) + if (GoodObject(absold) && GoodObject(Zone(absold)) && + (!GoodObject(absloc) || !GoodObject(Zone(absloc)) || + (Zone(absloc) != Zone(absold)))) did_it(what, Zone(absold), NULL, NULL, NULL, NULL, "AZLEAVE", old); - if (!GoodObject(absold) - || (GoodObject(Zone(absloc)) && (Zone(absloc) != Zone(absold)))) + if (GoodObject(absloc) && GoodObject(Zone(absloc)) && + (!GoodObject(absold) || !GoodObject(Zone(absold)) || + (Zone(absloc) != Zone(absold)))) did_it(what, Zone(absloc), NULL, NULL, NULL, NULL, "AZENTER", where); did_it(what, where, NULL, NULL, NULL, NULL, "AENTER", where); }