[nq,qw] Fix segfault when calling think

Think has no "other", and E_POINTER doesn't check for null (by design:
it's meant to be as fast as possible).
This commit is contained in:
Bill Currie 2022-02-06 19:48:59 +09:00
parent 748f578856
commit ff08ef3fa3
2 changed files with 2 additions and 2 deletions

View file

@ -224,7 +224,7 @@ sv_pr_exec (edict_t *self, edict_t *other, pr_func_t func)
PR_RESET_PARAMS (&sv_pr_state);
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
P_INT (&sv_pr_state, 1) = 0;
P_INT (&sv_pr_state, 2) = E_POINTER (other, this);
P_INT (&sv_pr_state, 2) = other ? E_POINTER (other, this) : 0;
}
PR_ExecuteProgram (&sv_pr_state, func);
if ((this = sv_pr_state.fields.this) != -1) {

View file

@ -229,7 +229,7 @@ sv_pr_exec (edict_t *self, edict_t *other, pr_func_t func)
PR_RESET_PARAMS (&sv_pr_state);
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
P_INT (&sv_pr_state, 1) = 0;
P_INT (&sv_pr_state, 2) = E_POINTER (other, this);
P_INT (&sv_pr_state, 2) = other ? E_POINTER (other, this) : 0;
}
PR_ExecuteProgram (&sv_pr_state, func);
if ((this = sv_pr_state.fields.this) != -1) {