Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
4f33476f
Commit
4f33476f
authored
5 years ago
by
James R.
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-sector-lines' into 'next'
Fix sector.lines in Lua See merge request
!542
parents
c0b9671c
f028bb02
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!718
Rename R_IsPointInSubsector to R_PointInSubsectorOrNull/Nil
,
!542
Fix sector.lines in Lua
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua_maplib.c
+2
-2
2 additions, 2 deletions
src/lua_maplib.c
with
2 additions
and
2 deletions
src/lua_maplib.c
+
2
−
2
View file @
4f33476f
...
...
@@ -445,7 +445,7 @@ static int sectorlines_get(lua_State *L)
// get the "linecount" by shifting our retrieved memory address of "lines" to where "linecount" is in the sector_t, then dereferencing the result
// we need this to determine the array's actual size, and therefore also the maximum value allowed as an index
// this only works if seclines is actually a pointer to a sector's lines member in memory, oh boy
numoflines
=
(
size_t
)(
*
(
seclines
-
(
offsetof
(
sector_t
,
lines
)
-
offsetof
(
sector_t
,
linecount
))));
numoflines
=
(
size_t
)(
*
(
size_t
*
)(((
size_t
)
seclines
)
-
(
offsetof
(
sector_t
,
lines
)
-
offsetof
(
sector_t
,
linecount
))));
/* OLD HACK
// check first linedef to figure which of its sectors owns this sector->lines pointer
...
...
@@ -479,7 +479,7 @@ static int sectorlines_num(lua_State *L)
return
luaL_error
(
L
,
"accessed sector_t.lines doesn't exist anymore."
);
// see comments in the _get function above
numoflines
=
(
size_t
)(
*
(
seclines
-
(
offsetof
(
sector_t
,
lines
)
-
offsetof
(
sector_t
,
linecount
))));
numoflines
=
(
size_t
)(
*
(
size_t
*
)(((
size_t
)
seclines
)
-
(
offsetof
(
sector_t
,
lines
)
-
offsetof
(
sector_t
,
linecount
))));
lua_pushinteger
(
L
,
numoflines
);
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment