From 6f7401ea027a28db7dbfc981b0a23086f31fc920 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 12 Jul 2014 16:30:38 +0200 Subject: fix the crash that occurs, for example, when selecting a cuboid to build this also possibly fixes "relaying cuboids" also add proper declarations for related functions --- src/game/g_client.c | 8 ++++---- src/game/g_local.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/g_client.c b/src/game/g_client.c index 0f96ce6..8aa5bd8 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1797,10 +1797,10 @@ G_RelayCuboidToSpectators Called everytime a player changes his cuboid size. ============ */ -void G_RelayCuboidToSpectators( gentity_t *self ) +void G_RelayCuboidToSpectators( gclient_t *client ) { - self->client->ps.misc[ MISC_CUBOID_X ] = self->client->cuboidSelection[ 0 ] * 10; - self->client->ps.misc[ MISC_CUBOID_Y ] = self->client->cuboidSelection[ 1 ] * 10; - self->client->ps.misc[ MISC_CUBOID_Z ] = self->client->cuboidSelection[ 2 ] * 10; + client->ps.misc[ MISC_CUBOID_X ] = client->cuboidSelection[ 0 ] * 10; + client->ps.misc[ MISC_CUBOID_Y ] = client->cuboidSelection[ 1 ] * 10; + client->ps.misc[ MISC_CUBOID_Z ] = client->cuboidSelection[ 2 ] * 10; } diff --git a/src/game/g_local.h b/src/game/g_local.h index 944140f..17136ce 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -824,6 +824,9 @@ const char *G_CuboidName(buildable_t buildable, const vec3_t cuboidSize, void G_LayoutBuildItem( buildable_t buildable, vec3_t origin, vec3_t angles, vec3_t origin2, vec3_t angles2 ); void G_RemoveUnbuiltBuildables( gentity_t *self ); void G_UpdatePowerGrid( float dt ); +int G_GetBuildPoints( const vec3_t pos, team_t team ); +void G_RelayCuboidToSpectators( gclient_t *client ); +qboolean G_CheckCuboidSize( vec3_t dims, buildable_t type ); // // g_utils.c -- cgit