Skip to content

Commit 53e1620

Browse files
authored
Merge pull request #3472 from cmitu/eduke32-bugfix
eduke32: patch a gameplay bug in E1L4
2 parents cdc4dbb + 29ae766 commit 53e1620

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

scriptmodules/ports/eduke32.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ function sources_eduke32() {
3939
isPlatform "gles" && applyPatch "$md_data/0003-replace-gl_red.patch"
4040
# gcc 6.3.x compiler fix
4141
applyPatch "$md_data/0004-recast-function.patch"
42+
# cherry-picked commit fixing a game bug in E1M4 (shrinker ray stuck)
43+
applyPatch "$md_data/0005-e1m4-shrinker-bug.patch"
4244
}
4345

4446
function build_eduke32() {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp
2+
index 9a4405b2b..21f2570a4 100644
3+
--- a/source/duke3d/src/actors.cpp
4+
+++ b/source/duke3d/src/actors.cpp
5+
@@ -507,25 +507,16 @@ int32_t A_MoveSpriteClipdist(int32_t spriteNum, vec3_t const * const change, uin
6+
7+
int returnValue;
8+
int32_t diffZ;
9+
- spriteheightofs(spriteNum, &diffZ, 0);
10+
- int newZ = pSprite->z - diffZ;
11+
+ spriteheightofs(spriteNum, &diffZ, 1);
12+
13+
- pSprite->z -= diffZ >> 1;
14+
- switch (pSprite->statnum)
15+
+ if (pSprite->statnum == STAT_PROJECTILE)
16+
+ returnValue = clipmovex(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, diffZ >> 3, diffZ >> 3, clipType, 1);
17+
+ else
18+
{
19+
- default:
20+
- {
21+
- returnValue = clipmove(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, ZOFFSET6, ZOFFSET6, clipType);
22+
- break;
23+
- }
24+
-
25+
- case STAT_PROJECTILE:
26+
- {
27+
- returnValue = clipmovex(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, diffZ >> 1, diffZ >> 1, clipType, 1);
28+
- break;
29+
- }
30+
+ pSprite->z -= diffZ >> 1;
31+
+ returnValue = clipmove(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, ZOFFSET6, ZOFFSET6, clipType);
32+
+ pSprite->z += diffZ >> 1;
33+
}
34+
- pSprite->z += diffZ >> 1;
35+
36+
// Testing: For some reason the assert below this was tripping for clients
37+
EDUKE32_UNUSED int16_t dbg_ClipMoveSectnum = newSectnum;
38+
@@ -573,6 +564,7 @@ int32_t A_MoveSpriteClipdist(int32_t spriteNum, vec3_t const * const change, uin
39+
40+
Bassert(newSectnum == pSprite->sectnum);
41+
42+
+ int newZ = pSprite->z;
43+
int32_t ceilhit, florhit;
44+
int const doZUpdate = change->z ? A_CheckNeedZUpdate(spriteNum, change->z, &newZ, &ceilhit, &florhit) : 0;
45+

0 commit comments

Comments
 (0)