Mapster undo fixes and some other relatively minor stuff... SPRITE_NOLIGHT flag to kill built in lights from CONs

git-svn-id: https://svn.eduke32.com/eduke32@1444 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-06-28 20:23:12 +00:00
parent 6f6f0900c8
commit f061313bef
5 changed files with 1949 additions and 1906 deletions

View file

@ -7853,6 +7853,17 @@ void G_MoveWorld(void)
{
spritetype *s = &sprite[i];
if ((s->cstat & 32768) || A_CheckSpriteFlags(i, SPRITE_NOLIGHT))
{
if (ActorExtra[i].lightptr != NULL)
{
polymer_deletelight(ActorExtra[i].lightId);
ActorExtra[i].lightId = -1;
ActorExtra[i].lightptr = NULL;
}
break;
}
if (ActorExtra[i].lightptr != NULL && ActorExtra[i].lightcount)
{
if (!(--ActorExtra[i].lightcount))
@ -7883,8 +7894,16 @@ void G_MoveWorld(void)
{
int32_t x, y;
if (s->cstat & 32768 || !inside(s->x+((sintable[(s->ang+512)&2047])>>9), s->y+((sintable[(s->ang)&2047])>>9), s->sectnum))
if ((s->cstat & 32768) || A_CheckSpriteFlags(i, SPRITE_NOLIGHT) || !inside(s->x+((sintable[(s->ang+512)&2047])>>9), s->y+((sintable[(s->ang)&2047])>>9), s->sectnum))
{
if (ActorExtra[i].lightptr != NULL)
{
polymer_deletelight(ActorExtra[i].lightId);
ActorExtra[i].lightId = -1;
ActorExtra[i].lightptr = NULL;
}
break;
}
x = ((sintable[(s->ang+512)&2047])>>7);
y = ((sintable[(s->ang)&2047])>>7);
@ -7981,7 +8000,7 @@ void G_MoveWorld(void)
{
int32_t x, y;
if ((s->cstat & 32768) || !inside(s->x+((sintable[(s->ang+512)&2047])>>9), s->y+((sintable[(s->ang)&2047])>>9), s->sectnum))
if ((s->cstat & 32768) || A_CheckSpriteFlags(i, SPRITE_NOLIGHT) || !inside(s->x+((sintable[(s->ang+512)&2047])>>9), s->y+((sintable[(s->ang)&2047])>>9), s->sectnum))
{
if (ActorExtra[i].lightptr != NULL)
{

File diff suppressed because it is too large Load diff

View file

@ -864,6 +864,7 @@ enum SpriteFlags_t {
SPRITE_BADGUY = 32,
SPRITE_NOPAL = 64,
SPRITE_NOEVENTCODE = 128,
SPRITE_NOLIGHT = 256,
};
extern int16_t SpriteCacheList[MAXTILES][3];

View file

@ -271,7 +271,7 @@ extern inline void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zof
extern void se40code(int32_t x,int32_t y,int32_t z,int32_t a,int32_t h, int32_t smoothratio);
extern void G_FreeMapState(int32_t mapnum);
extern void G_FindLevelForFilename(const char *fn, char *volume, char *level);
extern int32_t G_FindLevelForFilename(const char *fn);
extern void G_GetCrosshairColor(void);
extern void G_SetCrosshairColor(int32_t r, int32_t g, int32_t b);

View file

@ -742,7 +742,7 @@ void P_ResetWeapons(int32_t snum)
p->curr_weapon = PISTOL_WEAPON;
p->gotweapon[PISTOL_WEAPON] = 1;
p->gotweapon[KNEE_WEAPON] = 1;
p->ammo_amount[PISTOL_WEAPON] = 48;
p->ammo_amount[PISTOL_WEAPON] = min(p->max_ammo_amount[PISTOL_WEAPON], 48);
p->gotweapon[HANDREMOTE_WEAPON] = 1;
p->last_weapon = -1;
@ -1282,7 +1282,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
{
p->curr_weapon = i;
p->gotweapon[i] = 1;
p->ammo_amount[i] = 48;
p->ammo_amount[i] = min(p->max_ammo_amount[i], 48);
}
else if (aplWeaponWorksLike[i][0]==KNEE_WEAPON)
p->gotweapon[i] = 1;
@ -1625,19 +1625,20 @@ void Net_ResetPrediction(void)
extern int32_t voting, vote_map, vote_episode;
void G_FindLevelForFilename(const char *fn, char *volume, char *level)
int32_t G_FindLevelForFilename(const char *fn)
{
for (*volume=0; *volume<MAXVOLUMES; (*volume)++)
int32_t volume, level;
for (volume=0; volume<MAXVOLUMES; volume++)
{
for (*level=0; *level<MAXLEVELS; (*level)++)
for (level=0; level<MAXLEVELS; level++)
{
if (MapInfo[(*volume*MAXLEVELS)+*level].filename != NULL)
if (!Bstrcasecmp(fn, MapInfo[(*volume*MAXLEVELS)+*level].filename))
break;
if (MapInfo[(volume*MAXLEVELS)+level].filename != NULL)
if (!Bstrcasecmp(fn, MapInfo[(volume*MAXLEVELS)+level].filename))
return ((volume * MAXLEVELS) + level);
}
if (*level != MAXLEVELS)
break;
}
return MAXLEVELS;
}
int32_t G_EnterLevel(int32_t g)
@ -1669,14 +1670,17 @@ int32_t G_EnterLevel(int32_t g)
if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0)
{
char volume, level;
int32_t volume, level;
Bcorrectfilename(boardfilename,0);
G_FindLevelForFilename(boardfilename,&volume,&level);
volume = level = G_FindLevelForFilename(boardfilename);
if (level != MAXLEVELS)
{
level &= MAXLEVELS-1;
volume = (volume - level) / MAXLEVELS;
ud.level_number = ud.m_level_number = level;
ud.volume_number = ud.m_volume_number = volume;
boardfilename[0] = 0;