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,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 () {

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;

View File

@ -72,8 +72,7 @@
* todos within the code have a look at the \ref todo.
*
* \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] Add basic networking
* \todo [med] Add serialization
@ -87,7 +86,8 @@
* Engine::Module::Init()
*
* Done:
* - [high] In Physics remove dependancy on the Model to pass on collision
* \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
* events
* - [high] Fix Physics bug when two actors collide actively (i.e. velocity
* towards each other)