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
8b1ddcbd
Commit
8b1ddcbd
authored
10 months ago
by
Lactozilla
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-spriteinfo-indexing' into 'next'
Fix spriteinfo indexing Closes
#1255
See merge request
!2463
parents
7cc0dd1e
1ba9ecf0
No related branches found
No related tags found
1 merge request
!2463
Fix spriteinfo indexing
Pipeline
#4273
passed
10 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua_infolib.c
+4
-9
4 additions, 9 deletions
src/lua_infolib.c
with
4 additions
and
9 deletions
src/lua_infolib.c
+
4
−
9
View file @
8b1ddcbd
...
...
@@ -242,17 +242,12 @@ static int lib_getSpriteInfo(lua_State *L)
UINT32
i
=
NUMSPRITES
;
lua_remove
(
L
,
1
);
if
(
lua_
isstring
(
L
,
1
)
)
if
(
lua_
type
(
L
,
1
)
==
LUA_TSTRING
)
{
const
char
*
name
=
lua_tostring
(
L
,
1
);
INT32
spr
=
R_GetSpriteNumByName
(
name
);
if
(
spr
==
NUMSPRITES
)
{
char
*
check
;
i
=
strtol
(
name
,
&
check
,
10
);
if
(
check
==
name
||
*
check
!=
'\0'
)
return
luaL_error
(
L
,
"unknown sprite name %s"
,
name
);
}
return
luaL_error
(
L
,
"unknown sprite name %s"
,
name
);
i
=
spr
;
}
else
...
...
@@ -1740,7 +1735,7 @@ static int lib_setSkinColor(lua_State *L)
else
if
(
i
==
6
||
(
str
&&
fastcmp
(
str
,
"accessible"
)))
{
boolean
v
=
lua_toboolean
(
L
,
3
);
if
(
cnum
<
FIRSTSUPERCOLOR
&&
v
!=
skincolors
[
cnum
].
accessible
)
CONS_Alert
(
CONS_WARNING
,
"skincolors[] index %d is a standard color; accessibility changes are prohibited."
,
cnum
);
CONS_Alert
(
CONS_WARNING
,
"skincolors[] index %d is a standard color; accessibility changes are prohibited.
\n
"
,
cnum
);
else
info
->
accessible
=
v
;
}
...
...
@@ -1835,7 +1830,7 @@ static int skincolor_set(lua_State *L)
else
if
(
fastcmp
(
field
,
"accessible"
))
{
boolean
v
=
lua_toboolean
(
L
,
3
);
if
(
cnum
<
FIRSTSUPERCOLOR
&&
v
!=
skincolors
[
cnum
].
accessible
)
CONS_Alert
(
CONS_WARNING
,
"skincolors[] index %d is a standard color; accessibility changes are prohibited."
,
cnum
);
CONS_Alert
(
CONS_WARNING
,
"skincolors[] index %d is a standard color; accessibility changes are prohibited.
\n
"
,
cnum
);
else
info
->
accessible
=
v
;
}
else
...
...
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