diff options
author | Stijn Buys <ingar@osirion.org> | 2013-09-29 13:14:44 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-09-29 13:14:44 +0000 |
commit | ce78048419f2cf6f86aeb22b78420da2d5523ba2 (patch) | |
tree | 24bc46d53c34687d7b8465eab7f0595f6260212c /src | |
parent | 18dc1f6d0e044e5e4b1f3a40fcc65e532ec2e765 (diff) |
build-0.2.5-svn1327
Diffstat (limited to 'src')
-rw-r--r-- | src/core/entity.cc | 16 | ||||
-rw-r--r-- | src/core/entity.h | 10 | ||||
-rw-r--r-- | src/model/material.cc | 1 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index 589d132..b7d7646 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -1281,6 +1281,22 @@ void EntityControlable::set_target_controlflags(int controlflags) } } +void EntityControlable::set_target_controlflag(const ControlFlag controlflag) +{ + if (!has_controlflag(controlflag); + target_controlflags = target_controlflags | controlflag; + set_dirty(); + } +} + +void EntityControlable::unset_target_controlflag(const ControlFlag controlflag) +{ + if (has_controlflag(controlflag); + target_controlflags = target_controlflags & ~controlflag; + set_dirty(); + } +} + void EntityControlable::set_zone(Zone *zone) { if (entity_zone == zone) diff --git a/src/core/entity.h b/src/core/entity.h index df65843..c748e98 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -684,7 +684,7 @@ class EntityControlable : public EntityDynamic public: /// control flags - enum ControlFlags {ControlFlagNone = 0, ControlFlagFire = 1}; + enum ControlFlags {ControlFlagNone = 0, ControlFlagFire = 1, ControlFlagAutoPilot = 2, ControlFlagAutoDock = 4, ControlFlagAutoLevel = 8 }; /// bullet action interface class class ActionInterface: public btActionInterface { @@ -787,7 +787,13 @@ public: /// set target controlflags void set_target_controlflags(int controlflags); - + + /// set target control flags + void set_target_controlflag(const ControlFlag controlflag); + + /// unset target control flag + void unset_target_controlflag(const ControlFlag controlflag); + /** * @brief set the zone the entity is currently in * this fuction removes the entity from its previous zone diff --git a/src/model/material.cc b/src/model/material.cc index 5a99489..f8ffbc0 100644 --- a/src/model/material.cc +++ b/src/model/material.cc @@ -279,6 +279,7 @@ void Material::load_shader(const std::string &shadername) material->set_flags(FlagOrigin); } else if (firstword.compare("decal") == 0) { material->set_flags(FlagDecal); + } else if (firstword.compare("qer_editorimage") == 0) { // keyword qer_editorimage is ignored continue; |