diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 646ccb5..2ba8827 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -308,7 +308,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
308 | p = (OdePrim) prim; | 308 | p = (OdePrim) prim; |
309 | p.disableBody(); | 309 | p.disableBody(); |
310 | } | 310 | } |
311 | d.GeomDestroy(((OdePrim)prim).prim_geom); | 311 | if (((OdePrim)prim).prim_geom != null) |
312 | { | ||
313 | if (((OdePrim)prim).prim_geom != (IntPtr) 0) | ||
314 | d.GeomDestroy(((OdePrim)prim).prim_geom); | ||
315 | } | ||
312 | _prims.Remove((OdePrim)prim); | 316 | _prims.Remove((OdePrim)prim); |
313 | 317 | ||
314 | } | 318 | } |
@@ -1181,7 +1185,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1181 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); | 1185 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); |
1182 | // createmesh returns null when it's a shape that isn't a cube. | 1186 | // createmesh returns null when it's a shape that isn't a cube. |
1183 | if (mesh != null) | 1187 | if (mesh != null) |
1184 | setMesh(_parent_scene, mesh); | 1188 | { |
1189 | setMesh(_parent_scene, mesh); | ||
1190 | } | ||
1191 | else | ||
1192 | { | ||
1193 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); | ||
1194 | } | ||
1185 | } else { | 1195 | } else { |
1186 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); | 1196 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); |
1187 | 1197 | ||
@@ -1228,7 +1238,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1228 | if (this._parent_scene.needsMeshing(_pbs)) | 1238 | if (this._parent_scene.needsMeshing(_pbs)) |
1229 | { | 1239 | { |
1230 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); | 1240 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size); |
1231 | setMesh(_parent_scene, mesh); | 1241 | if (mesh != null) |
1242 | { | ||
1243 | setMesh(_parent_scene, mesh); | ||
1244 | } | ||
1245 | else | ||
1246 | { | ||
1247 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); | ||
1248 | } | ||
1232 | } else { | 1249 | } else { |
1233 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); | 1250 | prim_geom = d.CreateBox(_parent_scene.space, _size.X, _size.Y, _size.Z); |
1234 | } | 1251 | } |