fixes for a couple of issues

git-svn-id: https://svn.eduke32.com/eduke32@932 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-08-04 03:48:46 +00:00
parent 9e647243fa
commit 524db3d755
5 changed files with 41 additions and 21 deletions

View file

@ -918,7 +918,8 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int type)
searchpath_t *search = NULL; searchpath_t *search = NULL;
BDIR *dir; BDIR *dir;
struct Bdirent *dirent; struct Bdirent *dirent;
const char *d = "."; // Adjusted for the following "autoload" dir fix - NY00123
const char *d = "./";
int stackdepth = CACHE1D_SOURCE_CURDIR; int stackdepth = CACHE1D_SOURCE_CURDIR;
char buf[BMAX_PATH]; char buf[BMAX_PATH];
@ -928,9 +929,10 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int type)
{ {
if (!pathsearchmode) if (!pathsearchmode)
{ {
strcpy(buf, path); // Fix for "autoload" dir in multi-user environments - NY00123
strcpy(buf, d);
strcat(buf, path);
if (*path) strcat(buf, "/"); if (*path) strcat(buf, "/");
strcat(buf, d);
} }
else strcpy(buf, d); else strcpy(buf, d);
dir = Bopendir(buf); dir = Bopendir(buf);

View file

@ -898,7 +898,6 @@ int getexternaladdress(char *buffer, const char *host, int port)
closesocket(mysock); closesocket(mysock);
j = Bstrlen(text); j = Bstrlen(text);
for (i=Bstrlen(tempbuf);i>0;i--) for (i=Bstrlen(tempbuf);i>0;i--)
{
if (!Bstrncmp(&tempbuf[i], text, j)) if (!Bstrncmp(&tempbuf[i], text, j))
{ {
i += j; i += j;
@ -911,7 +910,6 @@ int getexternaladdress(char *buffer, const char *host, int port)
ipaddr[j++] = '\0'; ipaddr[j++] = '\0';
break; break;
} }
}
Bmemcpy(buffer,&ipaddr,j); Bmemcpy(buffer,&ipaddr,j);
return(1); return(1);
} }

View file

@ -2357,9 +2357,9 @@ static void coolgaugetext(int snum)
static void tics(void) static void tics(void)
{ {
#define AVERAGEFRAMES 128 #define AVERAGEFRAMES 128
#define COLOR_RED 248 #define COLOR_RED 248
#define COLOR_WHITE 31 #define COLOR_WHITE 31
int i = totalclock; int i = totalclock;
static int frameval[AVERAGEFRAMES], framecnt = 0; static int frameval[AVERAGEFRAMES], framecnt = 0;
@ -8518,10 +8518,8 @@ static void setup_rancid_net(const char *fn)
Bstrcpy(tmp,strtok(tempbuf,".")); Bstrcpy(tmp,strtok(tempbuf,"."));
if (i == rancid_players && ((Bstrcmp(tmp,"192") == 0) || (Bstrcmp(tmp,"172") == 0) || (Bstrcmp(tmp,"169") == 0) || (Bstrcmp(tmp,"10") == 0))) if (i == rancid_players && ((Bstrcmp(tmp,"192") == 0) || (Bstrcmp(tmp,"172") == 0) || (Bstrcmp(tmp,"169") == 0) || (Bstrcmp(tmp,"10") == 0)))
{ {
int ii = getexternaladdress(tempbuf, "checkip.dyndns.org", 80); int ii = getexternaladdress(tempbuf, "checkip.dyndns.org", 8245);
if (!ii) ii = getexternaladdress(tempbuf, "checkip.dyndns.org", 80);
if (!ii)
ii = getexternaladdress(tempbuf, "checkip.dyndns.org", 8245);
if (ii) if (ii)
{ {
if (tempbuf[0]) if (tempbuf[0])

View file

@ -72,23 +72,44 @@ int GAME_getrowheight(int w)
return w>>3; return w>>3;
} }
void GAME_onshowosd(int shown)
{
vscrn();
if (numplayers == 1)
if ((shown && !ud.pause_on) || (!shown && ud.pause_on))
KB_KeyDown[sc_Pause] = 1;
}
//#define BGTILE 311 //#define BGTILE 311
//#define BGTILE 1156 //#define BGTILE 1156
#define BGTILE 1141 // BIGHOLE #define BGTILE 1141 // BIGHOLE
#define BGTILE_SIZEX 128
#define BGTILE_SIZEY 128
#define BORDTILE 3250 // VIEWBORDER #define BORDTILE 3250 // VIEWBORDER
#define BITSTH 1+32+8+16 // high translucency #define BITSTH 1+32+8+16 // high translucency
#define BITSTL 1+8+16 // low translucency #define BITSTL 1+8+16 // low translucency
#define BITS 8+16+64 // solid #define BITS 8+16+64 // solid
#define SHADE 16 #define SHADE 16
#define PALETTE 4 #define PALETTE 4
void GAME_onshowosd(int shown)
{
// fix for TCs like Layre which don't have the BGTILE for some reason
// most of this is copied from my dummytile stuff in defs.c
if (!tilesizx[BGTILE] || !tilesizy[BGTILE])
{
extern char faketile[MAXTILES];
int j;
tilesizx[BGTILE] = BGTILE_SIZEX;
tilesizy[BGTILE] = BGTILE_SIZEY;
faketile[BGTILE] = 1;
picanm[BGTILE] = 0;
j = 15; while ((j > 1) && (pow2long[j] > BGTILE_SIZEX)) j--;
picsiz[BGTILE] = ((char)j);
j = 15; while ((j > 1) && (pow2long[j] > BGTILE_SIZEY)) j--;
picsiz[BGTILE] += ((char)(j<<4));
}
vscrn();
if (numplayers == 1)
if ((shown && !ud.pause_on) || (!shown && ud.pause_on))
KB_KeyDown[sc_Pause] = 1;
}
void GAME_clearbackground(int c, int r) void GAME_clearbackground(int c, int r)
{ {
int x, y, xsiz, ysiz, tx2, ty2; int x, y, xsiz, ysiz, tx2, ty2;

View file

@ -3604,7 +3604,8 @@ void processinput(int snum)
if (ud.config.ScreenWidth >= 800) if (ud.config.ScreenWidth >= 800)
adduserquote(tempbuf); adduserquote(tempbuf);
else OSD_Printf("%s\n",tempbuf); else OSD_Printf("%s\n",tempbuf);
} else krand(); }
else krand();
} }
else else
{ {