1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00

Hardwire sub-mission button in is_button_pressed to player->isRunning()

This commit is contained in:
Jannik Vogel 2016-06-11 13:27:57 +02:00
parent a58486fc4f
commit cf33ef8ca6

View File

@ -85,9 +85,18 @@ void game_set_time(const ScriptArguments& args)
bool game_is_button_pressed(const ScriptArguments& args)
{
/// @todo implement
RW_UNUSED(args);
int player = args[0].integerValue();
int index = args[1].integerValue();
RW_UNIMPLEMENTED("game_is_button_pressed()");
// NOTE: This is a hack. Hence we'll keep the unimplemented message for now.
if (player == 0) {
if (index == 19) { // look behind / sub-mission
/// @todo Return the keystate instead
auto object = args.getWorld()->pedestrianPool.find(args.getState()->playerObject);
auto player = static_cast<CharacterObject*>(object);
return player->isRunning();
}
}
return false;
}