From 22882f01ed537cae28b2ce80b86264a9c9c52b00 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 9 Jun 2016 08:29:18 -0400 Subject: proper game resetting --- src/mob.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mob.cpp') diff --git a/src/mob.cpp b/src/mob.cpp index ed9fbf4..7701086 100644 --- a/src/mob.cpp +++ b/src/mob.cpp @@ -350,11 +350,20 @@ void Trigger::act(void) xml.LoadFile(currentXML.c_str()); exml = xml.FirstChildElement("Trigger"); - while(exml->StrAttribute("id") != id) + while(exml && exml->StrAttribute("id") != id) exml = exml->NextSiblingElement(); player->vel.x = 0; + if (exml == nullptr) { + auto id = xmle->StrAttribute("cid"); + if (!id.empty()) { + game::setValue(id, xmle->StrAttribute("cvalue")); + game::briceUpdate(); + } + return; + } + ui::toggleBlackFast(); ui::waitForCover(); -- cgit v1.2.3