diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-12 00:33:19 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-12 00:33:19 -0500 |
commit | 5ecd0f428dd8292a17c5013c525a4f5d3967acb8 (patch) | |
tree | 0068b66a1183f822909f115a142fae3869a3b09f /src/input_system.cpp | |
parent | 19be2ac58b09c5240a32e6a4f41cd9f6cda03d07 (diff) | |
download | tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.tar.gz tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.tar.bz2 tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.zip |
Scripts are organised per-map now
Diffstat (limited to 'src/input_system.cpp')
-rw-r--r-- | src/input_system.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input_system.cpp b/src/input_system.cpp index 6ee442a..2201907 100644 --- a/src/input_system.cpp +++ b/src/input_system.cpp | |||
@@ -54,7 +54,7 @@ void InputSystem::tick(double dt) { | |||
54 | 54 | ||
55 | Sprite& collider = game_.getSprite(collision.horiz.colliderSprite); | 55 | Sprite& collider = game_.getSprite(collision.horiz.colliderSprite); |
56 | if (collider.interactionScript != "") { | 56 | if (collider.interactionScript != "") { |
57 | game_.getSystem<ScriptSystem>().runScript(collider.interactionScript); | 57 | game_.getSystem<ScriptSystem>().runScript(game_.getMap().getName(), collider.interactionScript); |
58 | activated = true; | 58 | activated = true; |
59 | } | 59 | } |
60 | } else if (collision.vert.colliderSprite != -1) { | 60 | } else if (collision.vert.colliderSprite != -1) { |
@@ -62,7 +62,7 @@ void InputSystem::tick(double dt) { | |||
62 | 62 | ||
63 | Sprite& collider = game_.getSprite(collision.vert.colliderSprite); | 63 | Sprite& collider = game_.getSprite(collision.vert.colliderSprite); |
64 | if (collider.interactionScript != "") { | 64 | if (collider.interactionScript != "") { |
65 | game_.getSystem<ScriptSystem>().runScript(collider.interactionScript); | 65 | game_.getSystem<ScriptSystem>().runScript(game_.getMap().getName(), collider.interactionScript); |
66 | activated = true; | 66 | activated = true; |
67 | } | 67 | } |
68 | } | 68 | } |
@@ -70,7 +70,7 @@ void InputSystem::tick(double dt) { | |||
70 | } | 70 | } |
71 | 71 | ||
72 | if (inFrontOfSomething && !activated) { | 72 | if (inFrontOfSomething && !activated) { |
73 | game_.getSystem<ScriptSystem>().runScript("default"); | 73 | game_.getSystem<ScriptSystem>().runScript("global", "no_problem_here"); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | } else if (e.key.keysym.sym == SDLK_LEFT) { | 76 | } else if (e.key.keysym.sym == SDLK_LEFT) { |