Game Development Community

BUG: River crashes dedicated server (fix inside)

by Matt Kronyak · in Torque 3D Professional · 04/06/2010 (5:06 pm) · 2 replies

When running a dedicated server a mission with a River object will cause the server to immediately crash in:
River::onAdd()

The problem ends up being in:
void River::_generateSegments()

which is called by:
void River::_generateSlices()

The exception occurs around the allocation of the VertexBuffer.

A simple solution to this is simply to check if the river is a server object prior to calling _generateSlices().

You could do this right in River::_generateSlices()itself or, as I chose to do, add this line to the end of void River::_generateSegments()

change
_generateVerts();
to
if(!isServerObject())
		_generateVerts();


#1
04/29/2010 (4:17 am)
Nice.
Keep us updated with any others like this that you find.
#2
04/29/2010 (4:20 am)
Just out of interest, MeshRoad appears to use very similar code to the river. Not tried it myself, but there's a potential crash there too I think.

**edit - MeshRoad already checks that it's client side before generating vert buffer