mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-27 06:32:27 +00:00
Check pointer before accessing it
Not the other way around.
This commit is contained in:
parent
a8b1d3a364
commit
4378246a3a
1 changed files with 3 additions and 3 deletions
|
@ -1418,13 +1418,13 @@ void idBrushBSP::FloodThroughPortals_r( idBrushBSPNode *node, int contents, int
|
||||||
idBrushBSPPortal *p;
|
idBrushBSPPortal *p;
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
if ( node->occupied ) {
|
|
||||||
common->Error( "FloodThroughPortals_r: node already occupied\n" );
|
|
||||||
}
|
|
||||||
if ( !node ) {
|
if ( !node ) {
|
||||||
common->Error( "FloodThroughPortals_r: NULL node\n" );
|
common->Error( "FloodThroughPortals_r: NULL node\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( node->occupied ) {
|
||||||
|
common->Error( "FloodThroughPortals_r: node already occupied\n" );
|
||||||
|
}
|
||||||
node->occupied = depth;
|
node->occupied = depth;
|
||||||
|
|
||||||
for ( p = node->portals; p; p = p->next[s] ) {
|
for ( p = node->portals; p; p = p->next[s] ) {
|
||||||
|
|
Loading…
Reference in a new issue