mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 13:10:34 +00:00
[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:
parent
748f578856
commit
ff08ef3fa3
2 changed files with 2 additions and 2 deletions
|
@ -224,7 +224,7 @@ sv_pr_exec (edict_t *self, edict_t *other, pr_func_t func)
|
||||||
PR_RESET_PARAMS (&sv_pr_state);
|
PR_RESET_PARAMS (&sv_pr_state);
|
||||||
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
|
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
|
||||||
P_INT (&sv_pr_state, 1) = 0;
|
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);
|
PR_ExecuteProgram (&sv_pr_state, func);
|
||||||
if ((this = sv_pr_state.fields.this) != -1) {
|
if ((this = sv_pr_state.fields.this) != -1) {
|
||||||
|
|
|
@ -229,7 +229,7 @@ sv_pr_exec (edict_t *self, edict_t *other, pr_func_t func)
|
||||||
PR_RESET_PARAMS (&sv_pr_state);
|
PR_RESET_PARAMS (&sv_pr_state);
|
||||||
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
|
P_INT (&sv_pr_state, 0) = E_POINTER (self, this);
|
||||||
P_INT (&sv_pr_state, 1) = 0;
|
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);
|
PR_ExecuteProgram (&sv_pr_state, func);
|
||||||
if ((this = sv_pr_state.fields.this) != -1) {
|
if ((this = sv_pr_state.fields.this) != -1) {
|
||||||
|
|
Loading…
Reference in a new issue