Changeset 9712 in orxonox.OLD for branches/new_class_id/src/world_entities
- Timestamp:
- Sep 1, 2006, 12:52:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/npcs/space_turret.cc
r9709 r9712 38 38 */ 39 39 SpaceTurret::SpaceTurret(const TiXmlElement* root) 40 : NPC(root)40 : NPC(root) 41 41 { 42 42 this->init(); … … 50 50 */ 51 51 SpaceTurret::~SpaceTurret () 52 { 53 54 } 52 {} 55 53 56 54 … … 100 98 101 99 element = root->FirstChildElement("weapon-left"); 102 if (element != NULL) element = element->FirstChildElement(); 103 this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 100 if (element != NULL) 101 element = element->FirstChildElement(); 102 if (element != NULL) 103 this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 104 104 if (this->left) 105 105 { … … 114 114 115 115 element = root->FirstChildElement("weapon-right"); 116 if (element != NULL) if (element != NULL) element = element->FirstChildElement(); 117 this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 116 if (element != NULL) 117 element = element->FirstChildElement(); 118 if (element != NULL) 119 this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 118 120 if (this->right) 119 121 { … … 134 136 */ 135 137 void SpaceTurret::setWeaponLeft(const std::string& wLeft) 136 { 137 138 } 138 {} 139 139 140 140 /** … … 152 152 { 153 153 if(this->getHealth() > 0.0f && State::getPlayer() && 154 State::getPlayer()->getPlayable() &&155 State::getPlayer()->getPlayable()->distance(this) < 300) // HACK156 { 157 if (likely(this->left != NULL))158 {159 // this->left->tickW(dt);160 this->left->requestAction(WA_SHOOT);161 }162 if (likely(this->right != NULL))163 {164 // this->right->tickW(dt);165 this->right->requestAction(WA_SHOOT);166 }154 State::getPlayer()->getPlayable() && 155 State::getPlayer()->getPlayable()->distance(this) < 300) // HACK 156 { 157 if (likely(this->left != NULL)) 158 { 159 // this->left->tickW(dt); 160 this->left->requestAction(WA_SHOOT); 161 } 162 if (likely(this->right != NULL)) 163 { 164 // this->right->tickW(dt); 165 this->right->requestAction(WA_SHOOT); 166 } 167 167 } 168 168 } … … 185 185 this->getModel(3)->draw(); 186 186 glPopMatrix(); 187 /*188 if (this->left != NULL)189 this->left->draw();190 if (this->right != NULL)191 this->right->draw();*/187 /* 188 if (this->left != NULL) 189 this->left->draw(); 190 if (this->right != NULL) 191 this->right->draw();*/ 192 192 } 193 193 … … 199 199 */ 200 200 void SpaceTurret::postSpawn () 201 { 202 203 } 201 {} 204 202 205 203 /** … … 208 206 */ 209 207 void SpaceTurret::leftWorld () 210 { 211 212 } 208 {} 213 209 214 210 void SpaceTurret::destroy(WorldEntity* killer)
Note: See TracChangeset
for help on using the changeset viewer.