diff --git a/source/src/Makefile b/source/src/Makefile index b553a099..4f61d160 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -47,7 +47,7 @@ CLIENT_OBJS= \ bot/ac_bot_ai.o -SERVER_LIBS=-L../enet -lenet +SERVER_LIBS=-L../enet -lenet -lz SERVER_FILES= \ serverms.cpp \ server.cpp \ diff --git a/source/src/server.cpp b/source/src/server.cpp index 4101b1fc..0c858870 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1,6 +1,14 @@ // server.cpp: little more than enhanced multicaster // runs dedicated or as client coroutine +#ifdef WIN32 +#include +#else +#include +#define _dup dup +#define _fileno fileno +#endif + #include "cube.h" #include "servercontroller.h" @@ -356,10 +364,10 @@ string smapname; char *adminpasswd = NULL, *motd = NULL; -int countclients(int type, bool not=false) +int countclients(int type, bool exclude = false) { int num = 0; - loopv(clients) if((!not && clients[i]->type == type) || (not && clients[i]->type != type)) num++; + loopv(clients) if((clients[i]->type!=type)==exclude) num++; return num; } diff --git a/source/src/serveractions.h b/source/src/serveractions.h index cfc46221..eade13f8 100644 --- a/source/src/serveractions.h +++ b/source/src/serveractions.h @@ -150,4 +150,5 @@ struct cleardemosaction : serveraction role = CR_MASTER; dedicated = true; } -}; \ No newline at end of file +}; + diff --git a/source/src/sound.cpp b/source/src/sound.cpp index d14d02d4..842b62f2 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -286,7 +286,7 @@ void checkplayerloopsounds() // sync to model animation int basetime = -((int)(size_t)p&0xFFF); int time = lastmillis-basetime; - int speed = 1860/p->maxspeed; + int speed = int(1860/p->maxspeed); // TODO: share with model code if(time%speed < footstepalign) playsound(S_FOOTSTEPS, p);