Skip to content

Commit 247d203

Browse files
authored
Merge pull request #4056 from s1eve-mcdichae1/dukepatch
eduke32.sh - patch a gameplay bug in e4m4
2 parents 2cb9622 + 5e9d997 commit 247d203

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

scriptmodules/ports/eduke32.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ function sources_eduke32() {
4141
applyPatch "$md_data/0004-recast-function.patch"
4242
# cherry-picked commit fixing a game bug in E1M4 (shrinker ray stuck)
4343
applyPatch "$md_data/0005-e1m4-shrinker-bug.patch"
44+
# two more commits r8241 + r8247 fixing a bug in E4M4 (instant death in water)
45+
applyPatch "$md_data/0006-e4m4-water-bug.patch"
4446
}
4547

4648
function build_eduke32() {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp
2+
index 24eb02368..1a7b57bb5 100644
3+
--- a/source/build/src/clip.cpp
4+
+++ b/source/build/src/clip.cpp
5+
@@ -945,14 +945,22 @@ static int get_floorspr_clipyou(vec2_t const v1, vec2_t const v2, vec2_t const v
6+
return clipyou;
7+
}
8+
9+
-static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int const walldist)
10+
+static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int walldist)
11+
{
12+
if (inside_p(pos.x, pos.y, *sectnum))
13+
return;
14+
15+
+ int16_t nsecs = min<int16_t>(getsectordist(pos, *sectnum), INT16_MAX);
16+
+
17+
+ if (nsecs > (walldist + 8))
18+
+ {
19+
+ OSD_Printf("%s():%d shortest distance between origin point (%d, %d) and sector %d is %d. Sector may be corrupt!\n",
20+
+ EDUKE32_FUNCTION, __LINE__, pos.x, pos.y, *sectnum, nsecs);
21+
+ walldist = 0x7fff;
22+
+ }
23+
+
24+
static int16_t sectlist[MAXSECTORS];
25+
static uint8_t sectbitmap[(MAXSECTORS+7)>>3];
26+
- int16_t nsecs;
27+
28+
bfirst_search_init(sectlist, sectbitmap, &nsecs, MAXSECTORS, *sectnum);
29+

0 commit comments

Comments
 (0)