Skip to content

Commit

Permalink
SERVER: Fix for 64-bit save-game files
Browse files Browse the repository at this point in the history
Ensure all "" references are set to string ref 0 (should fix
  any affected save-game files)
Looks like dimman's previous fix for 64-bit load/save
  (QW-Group@21b5ddc)
  didn't ever make it into mvdsv, so was removed again
  during sync to 3.1 - this led to extra fields being written
  out that didn't need to be included.

Fixes QW-Group#297
  • Loading branch information
meag committed Nov 7, 2018
1 parent bd41b13 commit 8ab558f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ static int pr_globaloffsetpatch_nq[62] = {0,0,0,0,0,666,-4,-4,8,8,
8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8, 8,8};
#endif

int type_size[8] =
{
int type_size[8] = {
1, // void
sizeof(void *)/4, // string_t
1, // string_t
1, // float
3, // vector
1, // entity
1, // field
sizeof(void *)/4, // func_t
sizeof(void *)/4 // pointer (its an int index)
1, // func_t
1 // pointer (its an int index)
};

ddef_t *ED_FieldAtOfs (int ofs);
Expand Down
5 changes: 5 additions & 0 deletions pr_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,11 @@ void PR1_SetString(string_t* address, char* s)
return;
}

if (!s || !s[0]) {
*address = 0;
return;
}

if (s - pr_strings < 0) {
for (i = 0; i < num_prstr; i++) {
if (pr_strtbl[i] == s) {
Expand Down

0 comments on commit 8ab558f

Please sign in to comment.