Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Fix a last small point
Browse files Browse the repository at this point in the history
  • Loading branch information
Ydos2 committed Jun 20, 2021
1 parent b2cf4d2 commit be53232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions game/include/scripts/PlayerController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class PlayerController : public CppBehaviour {

std::size_t cur_track = 0;
bool started = false;
bool gameIsStart = false;

enum class stateAnim { Idle, Run, Attack };
stateAnim statePlayer = stateAnim::Idle;
Expand Down
4 changes: 3 additions & 1 deletion game/src/scripts/PlayerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ void PlayerController::update()
for (auto [ent, block, scriptMap] : world().query<PlayerTag, Scripts>()) {
nbrOfPlayer++;
}
if (m_life <= 0 || nbrOfPlayer == 1) {
if (nbrOfPlayer > 1)
gameIsStart = true;
if ((m_life <= 0 || nbrOfPlayer == 1) && gameIsStart == true) {
for (auto [ent, block, scriptMap] :
world().query<MapGeneratorTag, Scripts>()) {
auto scriptMapGenerator = scriptMap.get<MapGenerator>();
Expand Down

0 comments on commit be53232

Please sign in to comment.