[Orxonox-commit 3926] r8600 - code/branches/portals2/src/modules/portals
dafrick at orxonox.net
dafrick at orxonox.net
Thu May 26 15:56:04 CEST 2011
Author: dafrick
Date: 2011-05-26 15:56:04 +0200 (Thu, 26 May 2011)
New Revision: 8600
Modified:
code/branches/portals2/src/modules/portals/PortalEndPoint.cc
code/branches/portals2/src/modules/portals/PortalLink.cc
Log:
Some cleanup.
Modified: code/branches/portals2/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalEndPoint.cc 2011-05-26 13:44:07 UTC (rev 8599)
+++ code/branches/portals2/src/modules/portals/PortalEndPoint.cc 2011-05-26 13:56:04 UTC (rev 8600)
@@ -31,8 +31,8 @@
#include "objects/triggers/MultiTriggerContainer.h"
#include "portals/PortalLink.h"
#include "worldentities/MobileEntity.h"
+#include <ctime>
-
namespace orxonox
{
CreateFactory(PortalEndPoint);
@@ -41,16 +41,19 @@
std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
- PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(new DistanceMultiTrigger(this)), reenterDelay_(0)
+ PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(NULL), reenterDelay_(0)
{
RegisterObject(PortalEndPoint);
+
+ this->trigger_ = new DistanceMultiTrigger(this);
this->trigger_->setName("portal");
this->attach(trigger_);
}
PortalEndPoint::~PortalEndPoint()
{
-
+ if(this->isInitialized() && this->trigger_ != NULL)
+ delete this->trigger_;
}
void PortalEndPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -133,7 +136,7 @@
this->jumpOutTimes_[entity] = std::time(0);
this->recentlyJumpedOut_.insert(entity);
- // adjust
+ // adjust
entity->setPosition(this->getWorldPosition());
entity->rotate(this->getWorldOrientation());
entity->setVelocity(this->getWorldOrientation() * entity->getVelocity());
Modified: code/branches/portals2/src/modules/portals/PortalLink.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalLink.cc 2011-05-26 13:44:07 UTC (rev 8599)
+++ code/branches/portals2/src/modules/portals/PortalLink.cc 2011-05-26 13:56:04 UTC (rev 8600)
@@ -44,6 +44,7 @@
PortalLink::~PortalLink()
{
+
}
void PortalLink::XMLPort(Element& xmlelement, XMLPort::Mode mode)
More information about the Orxonox-commit
mailing list