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
c70d5a97
Commit
c70d5a97
authored
4 years ago
by
Golden
Browse files
Options
Downloads
Patches
Plain Diff
Make `mapmusflags` and `mapmusname` writable.
parent
365e02bb
No related branches found
No related tags found
1 merge request
!1233
Make several Lua global variables writable.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua_script.c
+15
-0
15 additions, 0 deletions
src/lua_script.c
with
15 additions
and
0 deletions
src/lua_script.c
+
15
−
0
View file @
c70d5a97
...
...
@@ -399,6 +399,21 @@ int LUA_CheckGlobals(lua_State *L, const char *word)
if
(
player
)
displayplayer
=
player
-
players
;
}
else
if
(
fastcmp
(
word
,
"mapmusname"
))
{
size_t
strlength
;
const
char
*
str
=
luaL_checkstring
(
L
,
2
,
&
strlength
);
if
(
strlength
>
6
)
return
luaL_error
(
L
,
"string length out of range (maximum 6 characters)"
);
if
(
strlen
(
str
)
<
strlength
)
return
luaL_error
(
L
,
"string must not contain embedded zeros!"
);
strncpy
(
mapmusname
,
str
,
strlength
);
}
else
if
(
fastcmp
(
word
,
"mapmusflags"
))
mapmusflags
=
(
UINT16
)
luaL_checkinteger
(
L
,
2
);
else
return
0
;
...
...
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