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

main
Martin Felis (berta) 2010-09-11 16:09:15 +02:00
parent 61275239ce
commit bbb6f75964
3 changed files with 9 additions and 6 deletions

View File

@ -107,12 +107,14 @@ bool Cmd_ControllerAttack (std::vector<std::string> args) {
assert (ControllerInstance); assert (ControllerInstance);
ShipEntity* player_entity = (ShipEntity*) Engine::GetEntity (Engine::GetPlayerEntityId ()); ShipEntity* player_entity = (ShipEntity*) Engine::GetEntity (Engine::GetPlayerEntityId ());
assert (player_entity); if (player_entity) {
player_entity->Attack (); player_entity->Attack ();
return true; return true;
} }
return false;
}
void Controller::OnRegisterCommands () { void Controller::OnRegisterCommands () {
ControllerBase::OnRegisterCommands (); ControllerBase::OnRegisterCommands ();

View File

@ -359,6 +359,7 @@ int Model::DoSaveLevel (const char* filename) {
level_file.close(); level_file.close();
return 0; return 0;
} }
void Model::SetGameState (const unsigned int &state) { void Model::SetGameState (const unsigned int &state) {
mLastGameState = mGameState; mLastGameState = mGameState;

View File

@ -72,7 +72,6 @@
* todos within the code have a look at the \ref todo. * todos within the code have a look at the \ref todo.
* *
* \todo [high] Create a simple racing or asteroids game * \todo [high] Create a simple racing or asteroids game
* \todo [high] Since introduction of the IMGUI pressing 'space' in the menu crashes the game
* \todo [med] Clear all references of EntityVisualState and EntityGameState * \todo [med] Clear all references of EntityVisualState and EntityGameState
* \todo [med] Clarify functionalities of CreateEntity, KillEntity, RegisterEntity, UnregisterEntity (which frees memory, which does only change the state of the Model?) * \todo [med] Clarify functionalities of CreateEntity, KillEntity, RegisterEntity, UnregisterEntity (which frees memory, which does only change the state of the Model?)
* \todo [med] Add basic networking * \todo [med] Add basic networking
@ -87,6 +86,7 @@
* Engine::Module::Init() * Engine::Module::Init()
* *
* Done: * Done:
* \todo [high] (11-09-2010) Since introduction of the IMGUI pressing 'space' in the menu crashes the game
* - [high] In Physics remove dependancy on the Model to pass on collision * - [high] In Physics remove dependancy on the Model to pass on collision
* events * events
* - [high] Fix Physics bug when two actors collide actively (i.e. velocity * - [high] Fix Physics bug when two actors collide actively (i.e. velocity