Skip to content

Commit

Permalink
MACVENTURE: Implement opcode $cb (Get Current Day)
Browse files Browse the repository at this point in the history
In Deja Vu, Pete's All Nite Gun Palace is closed if you play the
game on a Sunday. I'm guessing that's the only place where this
opcode is used
  • Loading branch information
Torbjörn Andersson committed Sep 5, 2016
1 parent 623e4e2 commit ef71f37
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions engines/macventure/script.cpp
Expand Up @@ -1061,8 +1061,14 @@ void ScriptEngine::opcaTIME(EngineState *state, EngineFrame *frame) {
}

void ScriptEngine::opcbDAY(EngineState *state, EngineFrame *frame) {
// Probaby irrelevant, so we push Day [9]
state->push(9);
TimeDate t;
g_system->getTimeAndDate(t);

int weekday = 1 + t.tm_wday;
weekday = 1;
state->push(weekday);

debugC(2, kMVDebugScript, "Current day of week: %d", weekday);
}

void ScriptEngine::opccCHLD(EngineState *state, EngineFrame *frame) {
Expand Down

0 comments on commit ef71f37

Please sign in to comment.