Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Nov 9, 2024
1 parent 1aa8202 commit 3c5e6cd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* The positions of shadows cast by some monsters have improved.
* The new monsters no longer bob up and down when in a liquid sector.
* Adaptive translucency is now applied to projectiles fired by ghouls when the `r_sprites_translucency` CVAR is `on`.
* A bug is fixed whereby the calamity blade was inflicting too much damage.
* A bug is fixed whereby [Andrew Hulshult’s](https://www.hulshult.com/) *IDKFA* soundtrack wasn’t being played in some maps when [`extras.wad`](https://doomwiki.org/wiki/Extras.wad) was autoloaded.
* The volume of MP3 and Ogg Vorbis music lumps has increased slightly.
* Minor improvements have been made to the support of [*Master Levels*](https://doomwiki.org/wiki/Master_Levels_for_Doom_II), [*SIGIL*](https://romero.com/sigil), [*Chex Quest*](https://doomwiki.org/wiki/Chex_Quest), [*Chex Quest 2*](https://doomwiki.org/wiki/Chex_Quest#Chex_Quest_2), [*Ancient Aliens*](https://www.doomworld.com/idgames/levels/doom2/Ports/megawads/aaliens) and [*Back To Saturn X E2: Tower In The Fountain Of Sparks*](https://www.doomworld.com/forum/topic/69960).
Expand Down
52 changes: 26 additions & 26 deletions src/p_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2127,30 +2127,32 @@ void P_ShootSpecialLine(const mobj_t *thing, line_t *line)
// line special is gun triggered generalized linedef type
bool (*linefunc)(line_t *line) = NULL;

unsigned short special = line->special;

// check each range of generalized linedefs
if (line->special >= GenEnd)
if (special >= GenEnd)
{
// Out of range for GenFloors
}
else if (line->special >= GenFloorBase)
else if (special >= GenFloorBase)
{
if (!thing->player && ((line->special & FloorChange) || !(line->special & FloorModel)))
if (!thing->player && ((special & FloorChange) || !(special & FloorModel)))
return; // FloorModel is "Allow Monsters" if FloorChange is 0

linefunc = &EV_DoGenFloor;
}
else if (line->special >= GenCeilingBase)
else if (special >= GenCeilingBase)
{
if (!thing->player && ((line->special & CeilingChange) || !(line->special & CeilingModel)))
if (!thing->player && ((special & CeilingChange) || !(special & CeilingModel)))
return; // CeilingModel is "Allow Monsters" if CeilingChange is 0

linefunc = &EV_DoGenCeiling;
}
else if (line->special >= GenDoorBase)
else if (special >= GenDoorBase)
{
if (!thing->player)
{
if (!(line->special & DoorMonster))
if (!(special & DoorMonster))
return; // monsters disallowed from this door

if (line->flags & ML_SECRET) // they can't open secret doors either
Expand All @@ -2159,12 +2161,12 @@ void P_ShootSpecialLine(const mobj_t *thing, line_t *line)

linefunc = &EV_DoGenDoor;
}
else if (line->special >= GenLockedBase)
else if (special >= GenLockedBase)
{
if (!thing->player)
return; // monsters disallowed from unlocking doors

if ((line->special & TriggerType) == GunOnce || (line->special & TriggerType) == GunMany)
if ((special & TriggerType) == GunOnce || (special & TriggerType) == GunMany)
{
// jff 04/01/98 check for being a gun type before reporting door type
if (!P_CanUnlockGenDoor(line))
Expand All @@ -2175,30 +2177,30 @@ void P_ShootSpecialLine(const mobj_t *thing, line_t *line)

linefunc = &EV_DoGenLockedDoor;
}
else if (line->special >= GenLiftBase)
else if (special >= GenLiftBase)
{
if (!thing->player && !(line->special & LiftMonster))
if (!thing->player && !(special & LiftMonster))
return; // monsters disallowed

linefunc = &EV_DoGenLift;
}
else if (line->special >= GenStairsBase)
else if (special >= GenStairsBase)
{
if (!thing->player && !(line->special & StairMonster))
if (!thing->player && !(special & StairMonster))
return; // monsters disallowed

linefunc = &EV_DoGenStairs;
}
else if (line->special >= GenCrusherBase)
else if (special >= GenCrusherBase)
{
if (!thing->player && !(line->special & CrusherMonster))
if (!thing->player && !(special & CrusherMonster))
return; // monsters disallowed

linefunc = &EV_DoGenCrusher;
}

if (linefunc)
switch ((line->special & TriggerType) >> TriggerTypeShift)
switch ((special & TriggerType) >> TriggerTypeShift)
{
case GunOnce:
if (linefunc(line))
Expand All @@ -2217,13 +2219,13 @@ void P_ShootSpecialLine(const mobj_t *thing, line_t *line)
}

// Impacts that other things can activate.
if (!thing->player && line->special != GR_Door_OpenStay)
if (!thing->player && special != GR_Door_OpenStay)
return;

if (!P_CheckTag(line)) // jff 02/27/98 disallow zero tag on some types
return;

switch (line->special)
switch (special)
{
case G1_Floor_RaiseToLowestCeiling:
if (EV_DoFloor(line, RaiseFloor))
Expand Down Expand Up @@ -2953,11 +2955,11 @@ static void P_SpawnScrollers(void)

for (int i = 0; i < numlines; i++, line++)
{
fixed_t dx = line->dx >> SCROLL_SHIFT; // direction and speed of scrolling
fixed_t dy = line->dy >> SCROLL_SHIFT;
int control = -1; // no control sector or acceleration
bool accel = false;
int special = line->special;
fixed_t dx = line->dx >> SCROLL_SHIFT; // direction and speed of scrolling
fixed_t dy = line->dy >> SCROLL_SHIFT;
int control = -1; // no control sector or acceleration
bool accel = false;
unsigned short special = line->special;

// killough 03/07/98: Types 245-249 are same as 250-254 except that the
// first side's sector's heights cause scrolling when they change, and
Expand Down Expand Up @@ -3278,12 +3280,10 @@ static bool PIT_PushThing(mobj_t *thing)
//
void T_Pusher(pusher_t *pusher)
{
sector_t *sec;
sector_t *sec = sectors + pusher->affectee;
int xspeed, yspeed;
int ht = 0;

sec = sectors + pusher->affectee;

// Be sure the special sector type is still turned on. If so, proceed.
// Else, bail out; the sector type has been changed on us.
if (!(sec->special & PUSH_MASK))
Expand Down
2 changes: 1 addition & 1 deletion src/r_skydefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ skydefs_t *R_ParseSkyDefs(void)
if (lumpnum == -1)
return NULL;

if (!((json = cJSON_Parse(W_CacheLumpNum(lumpnum)))))
if (!((json = cJSON_ParseWithLength(W_CacheLumpNum(lumpnum), W_LumpLength(lumpnum)))))
{
cJSON_Delete(json);
C_Warning(1, "The " BOLD("SKYDEFS") " lump in " BOLD("%s") " couldn't be parsed.",
Expand Down
5 changes: 3 additions & 2 deletions src/wi_interlvl.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static void ParseLevelLayer(cJSON *json, interlevellayer_t *out)

interlevel_t *WI_ParseInterlevel(const char *lumpname)
{
int lumpnum = W_CheckNumForName(lumpname);
interlevel_t *out;
cJSON *json;
cJSON *data;
Expand All @@ -174,14 +175,14 @@ interlevel_t *WI_ParseInterlevel(const char *lumpname)
cJSON *js_layer = NULL;
interlevellayer_t *layers = NULL;

if (!(json = cJSON_Parse(W_CacheLumpName(lumpname)))
if (!(json = cJSON_ParseWithLength(W_CacheLumpNum(lumpnum), W_LumpLength(lumpnum)))
|| !cJSON_IsObject((data = cJSON_GetObjectItemCaseSensitive(json, "data")))
|| !cJSON_IsString((music = cJSON_GetObjectItemCaseSensitive(data, "music")))
|| !cJSON_IsString((backgroundimage = cJSON_GetObjectItemCaseSensitive(data, "backgroundimage"))))
{
cJSON_Delete(json);
C_Warning(1, "The " BOLD("%s") " lump in " BOLD("%s") " couldn't be parsed.",
lumpname, leafname(lumpinfo[W_GetNumForName(lumpname)]->wadfile->path));
lumpname, leafname(lumpinfo[lumpnum]->wadfile->path));
return NULL;
}

Expand Down

0 comments on commit 3c5e6cd

Please sign in to comment.