bug fixes
This commit is contained in:
parent
426e9c1b6c
commit
68d26f149c
@ -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
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user