Changeset 7221 in orxonox.OLD for trunk/src/world_entities/creatures
- Timestamp:
- Mar 15, 2006, 3:10:45 PM (19 years ago)
- Location:
- trunk/src/world_entities/creatures
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/creatures/md2_creature.cc
r7193 r7221 52 52 * @param fileName the name of the File to load the MD2Creature from (absolute path) 53 53 */ 54 MD2Creature::MD2Creature(const char*fileName)54 MD2Creature::MD2Creature(const std::string& fileName) 55 55 { 56 56 this->init(); … … 59 59 if(!doc.LoadFile()) 60 60 { 61 PRINTF(2)("Loading file %s failed for md2 creature.\n", fileName );61 PRINTF(2)("Loading file %s failed for md2 creature.\n", fileName.c_str()); 62 62 return; 63 63 } … … 255 255 this->shiftCoor (move); 256 256 257 if( this->bJump )257 if( this->bJump && likely(this->getModel(0) != NULL)) 258 258 { 259 259 ((MD2Model*)this->getModel(0))->setAnim(JUMP); 260 260 } 261 else if( this->bFire )261 else if( this->bFire && likely(this->getModel(0) != NULL)) 262 262 { 263 263 if( ((MD2Model*)this->getModel(0))->getAnim() != ATTACK) ((MD2Model*)this->getModel(0))->setAnim(ATTACK); 264 264 } 265 else if( fabs(move.len()) > 0.0f )265 else if( fabs(move.len()) > 0.0f && likely(this->getModel(0) != NULL)) 266 266 { 267 267 if( ((MD2Model*)this->getModel(0))->getAnim() != RUN) ((MD2Model*)this->getModel(0))->setAnim(RUN); 268 268 } 269 else 269 else if (likely(this->getModel(0) != NULL)) 270 270 { 271 271 if( ((MD2Model*)this->getModel(0))->getAnim() != STAND) ((MD2Model*)this->getModel(0))->setAnim(STAND); -
trunk/src/world_entities/creatures/md2_creature.h
r7092 r7221 19 19 public: 20 20 21 MD2Creature(const char*fileName);21 MD2Creature(const std::string& fileName); 22 22 MD2Creature(const TiXmlElement* root = NULL); 23 23 virtual ~MD2Creature();
Note: See TracChangeset
for help on using the changeset viewer.