spectator mode fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1473 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -118,7 +118,12 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
player1->clientnum = mycn; // we are now fully connected
|
||||
joining = getint(p);
|
||||
if(getint(p) > 0) conoutf("INFO: this server is password protected");
|
||||
if(joining<0 && getclientmap()[0]) changemap(getclientmap()); // we are the first client on this server, set map
|
||||
if(joining<0 && getclientmap()[0]) // we are the first client on this server, set map
|
||||
{
|
||||
string mode;
|
||||
itoa(mode, gamemode);
|
||||
callvote(SA_MAP, getclientmap(), mode); // FIXME
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "cube.h"
|
||||
|
||||
void itoa(char *s, int i) { s_sprintf(s)("%d", i); }
|
||||
char *exchangestr(char *o, char *n) { delete[] o; return newstring(n); }
|
||||
|
||||
int execcontext = IEXC_CORE;
|
||||
|
||||
@@ -275,7 +275,7 @@ void recomputecamera()
|
||||
playerent *p = players[player1->followplayercn];
|
||||
static physent followcam;
|
||||
static playerent *lastplayer;
|
||||
if(lastplayer != p)
|
||||
if(lastplayer != p || &followcam != camera1)
|
||||
{
|
||||
followcam = *(playerent*)p;
|
||||
followcam.type = ENT_CAMERA;
|
||||
|
||||
@@ -246,6 +246,7 @@ bool cmpf(char *fn, enet_uint32 c)
|
||||
|
||||
void endianswap(void *memory, int stride, int length) // little endian as storage format
|
||||
{
|
||||
#ifdef SDL_BYTEORDER
|
||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||
loop(w, length) loop(i, stride/2)
|
||||
{
|
||||
@@ -255,4 +256,5 @@ void endianswap(void *memory, int stride, int length) // little endian as stor
|
||||
p[stride-i-1] = t;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -457,6 +457,8 @@ template <class K, class T> struct hashtable
|
||||
}
|
||||
};
|
||||
|
||||
#define itoa(s, i) { s_sprintf(s)("%d", i); }
|
||||
|
||||
#define enumeratekt(ht,k,e,t,f,b) loopi((ht).size) for(hashtable<k,t>::chain *enumc = (ht).table[i]; enumc; enumc = enumc->next) { hashtable<k,t>::const_key &e = enumc->key; t &f = enumc->data; b; }
|
||||
#define enumerate(ht,t,e,b) loopi((ht).size) for((ht).enumc = (ht).table[i]; (ht).enumc; (ht).enumc = (ht).enumc->next) { t &e = (ht).enumc->data; b; }
|
||||
#define enumerateht(ht) loopi((ht).size) for((ht).enumc = (ht).table[i]; (ht).enumc; (ht).enumc = (ht).enumc->next)
|
||||
|
||||
Reference in New Issue
Block a user