From 6ad89403a5692bcc347d1d3c15ec4653d79c0877 Mon Sep 17 00:00:00 2001 From: Wolfgang Becker Date: Wed, 2 Aug 2006 22:23:11 +0000 Subject: [PATCH] Moving solids without physic-enabled are in COLGROUP_STATIC now. SVN-Revision: 4113 --- data/levels/test/scriptdoor.stl | 36 +++++++++++++++++++++++++++++++++--- src/object/scripted_object.cpp | 12 ++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/data/levels/test/scriptdoor.stl b/data/levels/test/scriptdoor.stl index b4c517fc3..7f5efa467 100644 --- a/data/levels/test/scriptdoor.stl +++ b/data/levels/test/scriptdoor.stl @@ -37,6 +37,26 @@ door3.set_solid( false );") (sprite "images/objects/bonus_block/brick.sprite") ) (scriptedobject + (name "foo") + (z-pos 0) + (visible #t) + (physic-enabled #t) + (solid #t) + (x 640) + (y 320) + (sprite "images/objects/bonus_block/brick.sprite") + ) + (scriptedobject + (name "door2") + (z-pos 0) + (visible #t) + (physic-enabled #f) + (solid #t) + (x 320) + (y 256) + (sprite "images/objects/bonus_block/brick.sprite") + ) + (scriptedobject (name "door1") (z-pos 0) (visible #t) @@ -47,13 +67,23 @@ door3.set_solid( false );") (sprite "images/objects/bonus_block/brick.sprite") ) (scriptedobject - (name "door2") + (name "foo") (z-pos 0) (visible #t) (physic-enabled #f) (solid #t) - (x 320) - (y 256) + (x 608) + (y 352) + (sprite "images/objects/bonus_block/brick.sprite") + ) + (scriptedobject + (name "foo") + (z-pos 0) + (visible #t) + (physic-enabled #f) + (solid #t) + (x 544) + (y 352) (sprite "images/objects/bonus_block/brick.sprite") ) (tilemap diff --git a/src/object/scripted_object.cpp b/src/object/scripted_object.cpp index ee6000bbb..65dffb49e 100644 --- a/src/object/scripted_object.cpp +++ b/src/object/scripted_object.cpp @@ -48,7 +48,11 @@ ScriptedObject::ScriptedObject(const lisp::Lisp& lisp) lisp.get("visible", visible); lisp.get("z-pos", layer); if( solid ){ - set_group( COLGROUP_MOVING ); + if( physic_enabled ){ + set_group( COLGROUP_MOVING ); + } else { + set_group( COLGROUP_STATIC ); + } } else { set_group( COLGROUP_DISABLED ); } @@ -130,7 +134,11 @@ ScriptedObject::set_solid(bool solid) { this->solid = solid; if( solid ){ - set_group( COLGROUP_MOVING ); + if( physic_enabled ){ + set_group( COLGROUP_MOVING ); + } else { + set_group( COLGROUP_STATIC ); + } } else { set_group( COLGROUP_DISABLED ); } -- 2.11.0