Commit f77b8e43 by Mario

Merge branch 'fix-floodentities' into 'master'

Fix FloodEntities origin-less check

Closes #57

See merge request !38
parents cd99e669 4f135b96
......@@ -831,7 +831,7 @@ vec_t FloatForKey( const entity_t *ent, const char *key ){
gets a 3-element vector value for an entity key
*/
void GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec ){
qboolean GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec ){
const char *k;
double v1, v2, v3;
......@@ -845,6 +845,9 @@ void GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec ){
vec[ 0 ] = v1;
vec[ 1 ] = v2;
vec[ 2 ] = v3;
/* true if the key is found, false otherwise */
return strlen( k );
}
......
......@@ -664,7 +664,7 @@ qboolean PlaceOccupant( node_t *headnode, vec3_t origin, entity_t *occupant, qbo
int FloodEntities( tree_t *tree ){
int i, s;
vec3_t origin, offset, scale, angles;
qboolean r, inside, skybox;
qboolean r, inside, skybox, found;
node_t *headnode;
entity_t *e, *tripped;
const char *value;
......@@ -684,10 +684,10 @@ int FloodEntities( tree_t *tree ){
e = &entities[ i ];
/* get origin */
GetVectorForKey( e, "origin", origin );
found = GetVectorForKey( e, "origin", origin );
/* as a special case, allow origin-less entities */
if ( VectorCompare( origin, vec3_origin ) ) {
if ( !found ) {
continue;
}
......
......@@ -1913,7 +1913,7 @@ qboolean KeyExists( const entity_t *ent, const char *key ); /
const char *ValueForKey( const entity_t *ent, const char *key );
int IntForKey( const entity_t *ent, const char *key );
vec_t FloatForKey( const entity_t *ent, const char *key );
void GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec );
qboolean GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec );
entity_t *FindTargetEntity( const char *target );
void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castShadows, int *recvShadows );
void InjectCommandLine( char **argv, int beginArgs, int endArgs );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment