From c5068bf77951a41b9e6f20f39646f4d074177470 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Fri, 22 Mar 2013 12:50:54 +1030 Subject: [PATCH] server: pass current player into SV_AddLinksToPhysents Signed-off-by: Kevin Shanahan --- QW/server/sv_user.c | 2 +- common/world.c | 19 ++++++++++--------- include/world.h | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/QW/server/sv_user.c b/QW/server/sv_user.c index 42c4f9d..8538dd4 100644 --- a/QW/server/sv_user.c +++ b/QW/server/sv_user.c @@ -1357,7 +1357,7 @@ SV_PlayerMove(const usercmd_t *cmd) maxs[i] = pmove.origin[i] + 256; } #if 1 - SV_AddLinksToPhysents(mins, maxs, &pestack); + SV_AddLinksToPhysents(sv_player, mins, maxs, &pestack); #else AddAllEntsToPmove(mins, maxs, &pestack); #endif diff --git a/common/world.c b/common/world.c index 5341113..271232a 100644 --- a/common/world.c +++ b/common/world.c @@ -142,8 +142,9 @@ AddLinksToPhysents ==================== */ static void -SV_AddLinksToPhysents_r(const areanode_t *node, const vec3_t mins, - const vec3_t maxs, physent_stack_t *pestack) +SV_AddLinksToPhysents_r(const areanode_t *node, const edict_t *player, + const vec3_t mins, const vec3_t maxs, + physent_stack_t *pestack) { const link_t *link, *next; const link_t *const solids = &node->solid_edicts; @@ -151,7 +152,7 @@ SV_AddLinksToPhysents_r(const areanode_t *node, const vec3_t mins, int i, playernum; physent_t *physent; - playernum = EDICT_TO_PROG(sv_player); + playernum = EDICT_TO_PROG(player); physent = &pestack->physents[pestack->numphysent]; /* touch linked edicts */ @@ -165,7 +166,7 @@ SV_AddLinksToPhysents_r(const areanode_t *node, const vec3_t mins, if (check->v.solid == SOLID_BSP || check->v.solid == SOLID_BBOX || check->v.solid == SOLID_SLIDEBOX) { - if (check == sv_player) + if (check == player) continue; for (i = 0; i < 3; i++) if (check->v.absmin[i] > maxs[i] @@ -195,16 +196,16 @@ SV_AddLinksToPhysents_r(const areanode_t *node, const vec3_t mins, return; if (maxs[node->axis] > node->dist) - SV_AddLinksToPhysents_r(node->children[0], mins, maxs, pestack); + SV_AddLinksToPhysents_r(node->children[0], player, mins, maxs, pestack); if (mins[node->axis] < node->dist) - SV_AddLinksToPhysents_r(node->children[1], mins, maxs, pestack); + SV_AddLinksToPhysents_r(node->children[1], player, mins, maxs, pestack); } void -SV_AddLinksToPhysents(const vec3_t mins, const vec3_t maxs, - physent_stack_t *pestack) +SV_AddLinksToPhysents(const edict_t *player, const vec3_t mins, + const vec3_t maxs, physent_stack_t *pestack) { - SV_AddLinksToPhysents_r(sv_areanodes, mins, maxs, pestack); + SV_AddLinksToPhysents_r(sv_areanodes, player, mins, maxs, pestack); } #endif diff --git a/include/world.h b/include/world.h index 7e91390..c29889d 100644 --- a/include/world.h +++ b/include/world.h @@ -90,8 +90,8 @@ SV_TraceLine(const vec3_t start, const vec3_t end, movetype_t type, #if defined(QW_HACK) && defined(SERVERONLY) #include "pmove.h" -void SV_AddLinksToPhysents(const vec3_t mins, const vec3_t maxs, - physent_stack_t *pestack); +void SV_AddLinksToPhysents(const edict_t *player, const vec3_t mins, + const vec3_t maxs, physent_stack_t *pestack); #endif #endif /* WORLD_H */