bug fixes

This commit is contained in:
Anselme 2017-09-25 18:10:12 +02:00
parent 426e9c1b6c
commit 68d26f149c
4 changed files with 6 additions and 6 deletions

View File

@ -2,4 +2,4 @@ bin_dir=$$PWD/deploy
lib_dir=$$PWD/lib
mmokoban_lib_dir=$$PWD/../mmokoban/lib
include_dir=$$PWD/../mmokoban/src
include_dir=$$PWD/../mmokoban/include
sfml_dir=$$PWD/../mmokoban/include

View File

@ -58,7 +58,7 @@ bool Janken::hasUniqueSolution(){
}
int Janken::getSolution(){
int solution;
int solution = 0;
float ratio, best_ratio = 0;
for(int i = 0;i < NB_COUPS; i++){
if ((ratio = played[i]/nb_played) > best_ratio){

View File

@ -61,12 +61,12 @@ void MMOkobanModule::start()
m_mmokoban_server = new Server(TCP_PORT);
m_mmokoban_server->initMap();
new std::thread(startUpdateLoop, m_mmokoban_server, m_running);
new std::thread(MMOkobanModule::startUpdateLoop, m_mmokoban_server, &m_running);
}
void MMOkobanModule::startUpdateLoop(Server* server, bool &running)
void MMOkobanModule::startUpdateLoop(Server* server, bool *running)
{
while(running)
while(*running)
server->update();
delete server;
}

View File

@ -13,7 +13,7 @@ class MMOkobanModule : public Module
void start();
void stop();
static void startUpdateLoop(Server* server, bool &running);
static void startUpdateLoop(Server* server, bool *running);
public:
MMOkobanModule();