aboutsummaryrefslogtreecommitdiffstats
path: root/src/mob.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-06-09 08:29:18 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-06-09 08:29:18 -0400
commit22882f01ed537cae28b2ce80b86264a9c9c52b00 (patch)
tree553dea987d50668b05181a6ed9abd0d0adf7cc30 /src/mob.cpp
parent6882786999581e2280c870249ae448c744767e73 (diff)
proper game resetting
Diffstat (limited to 'src/mob.cpp')
-rw-r--r--src/mob.cpp11
1 files changed, 10 insertions, 1 deletions
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();