fixed annoying bug which would crash the game when pressing spacebar when the game was not in GameRunning state
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -359,6 +359,7 @@ int Model::DoSaveLevel (const char* filename) {
|
||||
level_file.close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Model::SetGameState (const unsigned int &state) {
|
||||
mLastGameState = mGameState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user