diff --git a/pr_edict.c b/pr_edict.c index 9ab810f23..8e809b18b 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -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); diff --git a/pr_exec.c b/pr_exec.c index ca6bef20e..b764da61b 100644 --- a/pr_exec.c +++ b/pr_exec.c @@ -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) {