Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2014, 3:45:56 PM (11 years ago)
Author:
noep
Message:

Fixed a bug where part-entity-assignments were not created.

Location:
code/branches/modularships
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/data/levels/emptyLevel.oxw

    r10023 r10029  
    9898    </ModularSpaceShip>
    9999   
    100     <ModularSpaceShip position="0,-1000,-200" health="1000" maxhealth="2000" initialhealth="1000">
     100    <ModularSpaceShip position="0,-1000,-200" health="2000" maxhealth="4000" initialhealth="2000">
    101101      <templates>
    102102        <Template link=HeavyCruiser />
  • code/branches/modularships/data/levels/templates/HeavyCruiser.oxt

    r10023 r10029  
    1111   explosionchunks        = 6
    1212
    13    health            = 1000
    14    maxhealth         = 2000
    15    initialhealth     = 1000
     13   health            = 2000
     14   maxhealth         = 4000
     15   initialhealth     = 2000
    1616
    1717   shieldhealth        = 100
     
    5151   
    5252    <parts>
    53         <ShipPart name="frontL" health="100" damageabsorption="0.5" />
    54         <ShipPart name="frontR" health="100" damageabsorption="0.5" />
    55         <ShipPart name="partL" health="100" damageabsorption="0.5" />
    56         <ShipPart name="partR" health="100" damageabsorption="0.5" />
    57         <ShipPart name="sidearmL" health="201" damageabsorption="0.2" />
    58         <ShipPart name="sidearmLfront" health="100" damageabsorption="0.5" />
    59         <ShipPart name="sidearmR" health="200" damageabsorption="0.2" />
    60         <ShipPart name="sidearmRfront" health="100" damageabsorption="0.5" />
     53        <ShipPart name="frontL" initialhealth="10" damageabsorption="0.5" />
     54        <ShipPart name="frontR" initialhealth="10" damageabsorption="0.5" />
     55        <ShipPart name="partL" initialhealth="10" damageabsorption="0.5" />
     56        <ShipPart name="partR" initialhealth="10" damageabsorption="0.5" />
     57        <ShipPart name="sidearmL" initialhealth="20" damageabsorption="0.2" />
     58        <ShipPart name="sidearmLfront" initialhealth="10" damageabsorption="0.5" />
     59        <ShipPart name="sidearmR" initialhealth="20" damageabsorption="0.2" />
     60        <ShipPart name="sidearmRfront" initialhealth="10" damageabsorption="0.5" />
    6161    </parts>
    6262   
  • code/branches/modularships/src/orxonox/worldentities/WorldEntity.h

    r10011 r10029  
    206206
    207207            void notifyChildPropsChanged();
     208
     209            inline int getNumAttachedObj()
     210                { return this->children_.size(); }
    208211
    209212        protected:
  • code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10023 r10029  
    7878    {
    7979        // iterate through all attached objects
    80         for (unsigned int i=0; i < 100; i++)
     80        for (unsigned int i=0; i < this->getNumAttachedObj(); i++)
    8181        {
    8282            if (this->getAttachedObject(i) == NULL)
     83            {
    8384                break;
     85            }
    8486            // iterate through all attached parts
    8587            for(unsigned int j = 0; j < this->partList_.size(); j++)
     
    149151    void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    150152    {
    151         orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;
     153        /*orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;
    152154        orxout() << "UserPtr of said collisionShape: " << cs->getUserPointer() << endl;
    153155
     
    177179        //orxout() << "ShipPart of Entity " << cs->getUserPointer() << ": " << this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) << endl;
    178180
    179         orxout() << "CP_start" << endl;
    180 
    181181        if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
    182182            this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
    183183        else
    184184            SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs);
    185 
    186         orxout() << "CP_end" << endl;
    187185
    188186        /*
     
    267265        {
    268266            if(this->partList_[i] == part)
     267            {
    269268                this->partList_.erase(it);
     269                break;
     270            }
    270271            it++;
    271272        }
     
    275276            if (itt->second == part)
    276277            {
    277                 this->detach(itt->first);
     278                //this->detach(itt->first);
     279                //itt->first->destroy();
     280                itt->first->setActive(false);
     281                itt->first->setVisible(false);
     282                itt->first->setCollisionResponse(false);
    278283                this->partMap_.erase(itt);
    279284            }
Note: See TracChangeset for help on using the changeset viewer.