Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kart-Public
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alam Ed Arias
Kart-Public
Commits
dabed0cd
Commit
dabed0cd
authored
5 years ago
by
Latapostrophe
Browse files
Options
Downloads
Patches
Plain Diff
Attempt to fix replay loading crash
parent
428dc42e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/Mingw/Release/stmlls0b
+0
-0
0 additions, 0 deletions
bin/Mingw/Release/stmlls0b
src/lua_script.c
+10
-5
10 additions, 5 deletions
src/lua_script.c
with
10 additions
and
5 deletions
bin/Mingw/Release/stmlls0b
0 → 100644
+
0
−
0
View file @
dabed0cd
File added
This diff is collapsed.
Click to expand it.
src/lua_script.c
+
10
−
5
View file @
dabed0cd
...
...
@@ -1247,7 +1247,7 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
return
0
;
}
static
UINT8
UnArchiveValueDemo
(
int
TABLESINDEX
)
static
UINT8
UnArchiveValueDemo
(
int
TABLESINDEX
,
char
field
[
1024
]
)
{
UINT8
type
=
READUINT8
(
demo_p
);
switch
(
type
)
...
...
@@ -1299,7 +1299,12 @@ static UINT8 UnArchiveValueDemo(int TABLESINDEX)
LUA_PushUserdata
(
gL
,
&
states
[
READUINT16
(
demo_p
)],
META_STATE
);
break
;
case
ARCH_MOBJ
:
LUA_PushUserdata
(
gL
,
P_FindNewPosition
(
READUINT32
(
demo_p
)),
META_MOBJ
);
demo_p
+=
sizeof
(
UINT32
);
// Skip this data, we can't read a mobj here, it'd point to garbage and crash the game.
if
(
field
)
CONS_Alert
(
CONS_WARNING
,
"Cannot read mobj_t stored in player variable
\'
%s
\'
. Desyncs may occur.
\n
"
,
field
);
else
CONS_Alert
(
CONS_WARNING
,
"Couldn't read mobj_t
\n
"
);
break
;
case
ARCH_PLAYER
:
LUA_PushUserdata
(
gL
,
&
players
[
READUINT8
(
demo_p
)],
META_PLAYER
);
...
...
@@ -1383,7 +1388,7 @@ static void UnArchiveExtVarsDemo(void *pointer)
{
READSTRING
(
demo_p
,
field
);
CONS_Printf
(
"%s
\n
"
,
field
);
UnArchiveValueDemo
(
TABLESINDEX
);
UnArchiveValueDemo
(
TABLESINDEX
,
field
);
lua_setfield
(
gL
,
-
2
,
field
);
}
...
...
@@ -1452,9 +1457,9 @@ static void UnArchiveTablesDemo(void)
lua_rawgeti
(
gL
,
TABLESINDEX
,
i
);
while
(
true
)
{
if
(
UnArchiveValueDemo
(
TABLESINDEX
)
==
1
)
// read key
if
(
UnArchiveValueDemo
(
TABLESINDEX
,
NULL
)
==
1
)
// read key
break
;
if
(
UnArchiveValueDemo
(
TABLESINDEX
)
==
2
)
// read value
if
(
UnArchiveValueDemo
(
TABLESINDEX
,
NULL
)
==
2
)
// read value
n
++
;
if
(
lua_isnil
(
gL
,
-
2
))
// if key is nil (if a function etc was accidentally saved)
{
...
...
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