aboutsummaryrefslogtreecommitdiff
path: root/sword2/events.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-03-17 09:03:15 +0000
committerTorbjörn Andersson2004-03-17 09:03:15 +0000
commit4c3a68027f7f84a58664f77c847d24ab5b9757e4 (patch)
treebf20e888b9ea1cc2045df84aad12ef1cd54ec7de /sword2/events.cpp
parent03200025dfb030d887ff9b07d180a8f9e2f225bc (diff)
downloadscummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.gz
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.bz2
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.zip
Use the same syntax for accessing script variables as BS1 does, i.e. now
it's Logic::_scriptVars[ID] instead of just ID. Apart from looking cool, it makes it much easier to tell the difference between variables and constants when looking at the code. Of course, this sort of sweeping changes is jolly good for introducing truly weird regressions, which is why I waited until after 0.6.0. svn-id: r13331
Diffstat (limited to 'sword2/events.cpp')
-rw-r--r--sword2/events.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sword2/events.cpp b/sword2/events.cpp
index ad11bad8e4..e704897ac6 100644
--- a/sword2/events.cpp
+++ b/sword2/events.cpp
@@ -66,7 +66,7 @@ void Logic::setPlayerActionEvent(uint32 id, uint32 interact_id) {
bool Logic::checkEventWaiting(void) {
for (int i = 0; i < MAX_events; i++) {
- if (_eventList[i].id == ID)
+ if (_eventList[i].id == _scriptVars[ID])
return true;
}
@@ -78,7 +78,7 @@ void Logic::startEvent(void) {
// you must follow with a return IR_TERMINATE
for (int i = 0; i < MAX_events; i++) {
- if (_eventList[i].id == ID) {
+ if (_eventList[i].id == _scriptVars[ID]) {
// run 3rd script of target object on level 1
logicOne(_eventList[i].interact_id);
@@ -89,7 +89,7 @@ void Logic::startEvent(void) {
}
// oh dear - stop the system
- error("Start_event can't find event for id %d", ID);
+ error("Start_event can't find event for id %d", _scriptVars[ID]);
}
void Logic::clearEvent(uint32 id) {
@@ -149,14 +149,14 @@ int32 Logic::fnSendEvent(int32 *params) {
}
int32 Logic::fnCheckEventWaiting(int32 *params) {
- // returns yes/no in RESULT
+ // returns yes/no in _scriptVars[RESULT]
// params: none
if (checkEventWaiting())
- RESULT = 1;
+ _scriptVars[RESULT] = 1;
else
- RESULT = 0;
+ _scriptVars[RESULT] = 0;
return IR_CONT;
}
@@ -219,7 +219,7 @@ int32 Logic::fnPauseForEvent(int32 *params) {
int32 Logic::fnClearEvent(int32 *params) {
// params: none
- clearEvent(ID);
+ clearEvent(_scriptVars[ID]);
return IR_CONT;
}