fixed annoying bug which would crash the game when pressing spacebar when the game was not in GameRunning state

This commit is contained in:
2010-09-11 16:09:15 +02:00
parent 61275239ce
commit bbb6f75964
3 changed files with 9 additions and 6 deletions
+5 -3
View File
@@ -107,10 +107,12 @@ bool Cmd_ControllerAttack (std::vector<std::string> args) {
assert (ControllerInstance);
ShipEntity* player_entity = (ShipEntity*) Engine::GetEntity (Engine::GetPlayerEntityId ());
assert (player_entity);
player_entity->Attack ();
if (player_entity) {
player_entity->Attack ();
return true;
}
return true;
return false;
}
void Controller::OnRegisterCommands () {
+1
View File
@@ -359,6 +359,7 @@ int Model::DoSaveLevel (const char* filename) {
level_file.close();
return 0;
}
void Model::SetGameState (const unsigned int &state) {
mLastGameState = mGameState;