git-svn-id: https://svn.eduke32.com/eduke32@421 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2006-12-17 01:08:39 +00:00
parent 5c4f5b3744
commit a236be837c
3 changed files with 42 additions and 35 deletions

View file

@ -277,6 +277,9 @@ int addsearchpath(const char *p)
searchpathhead = srch; searchpathhead = srch;
if (srch->pathlen > maxsearchpathlen) maxsearchpathlen = srch->pathlen; if (srch->pathlen > maxsearchpathlen) maxsearchpathlen = srch->pathlen;
Bcorrectfilename(srch->path,0);
initprintf("addsearchpath(): Added %s\n", srch->path); initprintf("addsearchpath(): Added %s\n", srch->path);
return 0; return 0;

View file

@ -7429,7 +7429,7 @@ FOUNDCHEAT:
if (VOLUMEALL) if (VOLUMEALL)
{ {
volnume = cheatbuf[i] - '0'; volnume = cheatbuf[i] - '0';
levnume = (cheatbuf[i+1] - '0')*(MAXLEVELS-1)+(cheatbuf[i+2]-'0'); levnume = (cheatbuf[i+1] - '0')*10+(cheatbuf[i+2]-'0');
} }
else else
{ {
@ -9646,6 +9646,7 @@ int load_script(char *szScript)
void app_main(int argc,char **argv) void app_main(int argc,char **argv)
{ {
int i, j; int i, j;
char cwd[BMAX_PATH];
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
if (win_checkinstance()) if (win_checkinstance())
{ {
@ -9681,6 +9682,9 @@ void app_main(int argc,char **argv)
checkcommandline(argc,argv); checkcommandline(argc,argv);
if (getcwd(cwd,BMAX_PATH)) addsearchpath(cwd);
if (CommandPaths)
{ {
struct strllist *s; struct strllist *s;
while (CommandPaths) while (CommandPaths)
@ -9700,11 +9704,9 @@ void app_main(int argc,char **argv)
if (usecwd == 0) if (usecwd == 0)
#endif #endif
{ {
char cwd[BMAX_PATH];
char *homedir; char *homedir;
int asperr; int asperr;
if (getcwd(cwd,BMAX_PATH)) addsearchpath(cwd);
if ((homedir = Bgethomedir())) if ((homedir = Bgethomedir()))
{ {
Bsnprintf(cwd,sizeof(cwd),"%s/" Bsnprintf(cwd,sizeof(cwd),"%s/"
@ -9774,10 +9776,10 @@ void app_main(int argc,char **argv)
if (atol(tempbuf) > BUILDDATE) if (atol(tempbuf) > BUILDDATE)
{ {
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. " if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
"Browse to http://www.eduke32.com now?")) "Browse to http://eduke32.sourceforge.net now?"))
{ {
SHELLEXECUTEINFOA sinfo; SHELLEXECUTEINFOA sinfo;
char *p = "http://www.eduke32.com"; char *p = "http://eduke32.sourceforge.net";
Bmemset(&sinfo, 0, sizeof(sinfo)); Bmemset(&sinfo, 0, sizeof(sinfo));
sinfo.cbSize = sizeof(sinfo); sinfo.cbSize = sizeof(sinfo);
@ -9788,7 +9790,7 @@ void app_main(int argc,char **argv)
sinfo.lpClass = "http"; sinfo.lpClass = "http";
if(!ShellExecuteExA(&sinfo)) if(!ShellExecuteExA(&sinfo))
initprintf("Error launching browser!\n"); initprintf("update: error launching browser!\n");
CONFIG_SetupMouse(); CONFIG_SetupMouse();
CONFIG_SetupJoystick(); CONFIG_SetupJoystick();
CONFIG_WriteSetup(); CONFIG_WriteSetup();

View file

@ -5093,69 +5093,66 @@ int getspritescore(long snum, long dapicnum)
case FREEZEAMMO__STATIC: case FREEZEAMMO__STATIC:
if (ps[snum].ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10); if (ps[snum].ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10);
return(0); return(1);
case AMMO__STATIC: case AMMO__STATIC:
if (ps[snum].ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10); if (ps[snum].ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10);
return(0); return(1);
case BATTERYAMMO__STATIC: case BATTERYAMMO__STATIC:
if (ps[snum].ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20); if (ps[snum].ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20);
return(0); return(1);
case DEVISTATORAMMO__STATIC: case DEVISTATORAMMO__STATIC:
if (ps[snum].ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25); if (ps[snum].ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25);
return(0); return(1);
case RPGAMMO__STATIC: case RPGAMMO__STATIC:
if (ps[snum].ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50); if (ps[snum].ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50);
return(0); return(1);
case CRYSTALAMMO__STATIC: case CRYSTALAMMO__STATIC:
if (ps[snum].ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10); if (ps[snum].ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10);
return(0); return(1);
case HBOMBAMMO__STATIC: case HBOMBAMMO__STATIC:
if (ps[snum].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30); if (ps[snum].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30);
return(0); return(1);
case SHOTGUNAMMO__STATIC: case SHOTGUNAMMO__STATIC:
if (ps[snum].ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25); if (ps[snum].ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25);
return(0); return(1);
case COLA__STATIC: case COLA__STATIC:
if (sprite[ps[snum].i].extra < 100) return(10); if (sprite[ps[snum].i].extra < 100) return(10);
return(0); return(1);
case SIXPAK__STATIC: case SIXPAK__STATIC:
if (sprite[ps[snum].i].extra < 100) return(30); if (sprite[ps[snum].i].extra < 100) return(30);
return(0); return(1);
case FIRSTAID__STATIC: case FIRSTAID__STATIC:
if (ps[snum].firstaid_amount < 100) return(100); if (ps[snum].firstaid_amount < 100) return(100);
return(0); return(1);
case SHIELD__STATIC: case SHIELD__STATIC:
if (ps[snum].shield_amount < 100) return(50); if (ps[snum].shield_amount < 100) return(50);
return(0); return(1);
case STEROIDS__STATIC: case STEROIDS__STATIC:
if (ps[snum].steroids_amount < 400) return(30); if (ps[snum].steroids_amount < 400) return(30);
return(0); return(1);
case AIRTANK__STATIC: case AIRTANK__STATIC:
if (ps[snum].scuba_amount < 6400) return(30); if (ps[snum].scuba_amount < 6400) return(30);
return(0); return(1);
case JETPACK__STATIC: case JETPACK__STATIC:
if (ps[snum].jetpack_amount < 1600) return(100); if (ps[snum].jetpack_amount < 1600) return(100);
return(0); return(1);
case HEATSENSOR__STATIC: case HEATSENSOR__STATIC:
if (ps[snum].heat_amount < 1200) return(5); if (ps[snum].heat_amount < 1200) return(5);
return(0); return(1);
case ACCESSCARD__STATIC: case ACCESSCARD__STATIC:
return(1); return(1);
case BOOTS__STATIC: case BOOTS__STATIC:
if (ps[snum].boot_amount < 200) return(15); if (ps[snum].boot_amount < 200) return(15);
return(0); return(1);
case ATOMICHEALTH__STATIC: case ATOMICHEALTH__STATIC:
if (sprite[ps[snum].i].extra < max_player_health<<1) return(50); if (sprite[ps[snum].i].extra < max_player_health<<1) return(50);
return(0); return(1);
case HOLODUKE__STATIC: case HOLODUKE__STATIC:
if (ps[snum].holoduke_amount < 2400) return(5); if (ps[snum].holoduke_amount < 2400) return(5);
return(0); return(1);
case TOUCHPLATE__STATIC:
return(5);
case MUSICANDSFX__STATIC: case MUSICANDSFX__STATIC:
return(10); return(1);
} }
return(0); return(0);
} }
@ -5518,11 +5515,11 @@ void computergetinput(long snum, input *syn)
if ((goalsect[snum] < 0) || (goalwall[snum] < 0)) if ((goalsect[snum] < 0) || (goalwall[snum] < 0))
{ {
if (goalsprite[snum] < 0) if (goalsprite[snum] < 0 || !cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i))
{ {
int bestsprite = -1, spritescore = 0; int bestsprite = -1, spritescore = 0;
for (k=0;k<4;k++) for (k=0;k<16;k++)
{ {
i = (rand()%numsectors); i = (rand()%numsectors);
for (j=headspritesect[i];j>=0;j=nextspritesect[j]) for (j=headspritesect[i];j>=0;j=nextspritesect[j])
@ -5540,8 +5537,7 @@ void computergetinput(long snum, input *syn)
} }
} }
} }
if (bestsprite != -1 && (!cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i) || if (bestsprite != -1 && (goalsprite[snum] < 0 || spritescore > goalspritescore[snum]))
spritescore > goalspritescore[snum]))
{ {
goalx[snum] = sprite[bestsprite].x; goalx[snum] = sprite[bestsprite].x;
goaly[snum] = sprite[bestsprite].y; goaly[snum] = sprite[bestsprite].y;
@ -5562,8 +5558,11 @@ void computergetinput(long snum, input *syn)
else if (goalsprite[snum] != -1) else if (goalsprite[snum] != -1)
{ {
if (!cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i)) if (!cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i))
{
goalspritescore[snum] = 0;
goalsprite[snum] = -1; goalsprite[snum] = -1;
} }
}
x3 = p->posx; x3 = p->posx;
y3 = p->posy; y3 = p->posy;
@ -5617,7 +5616,10 @@ void computergetinput(long snum, input *syn)
if (goalsprite[snum] != -1) if (goalsprite[snum] != -1)
{ {
if (!cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i)) if (!cansee(x1,y1,z1-(32<<8),damysect,sprite[goalsprite[snum]].x,sprite[goalsprite[snum]].y,sprite[goalsprite[snum]].z-(4<<8),i))
{
goalsprite[snum] = -1; goalsprite[snum] = -1;
goalspritescore[snum] = 0;
}
} }
} }
else else