Ursprung
46d822fe6e
Commit
c64aab057d
@ -33,6 +33,7 @@
|
||||
#include "../../../train/traintracking.hpp"
|
||||
#include "../../../utils/displayname.hpp"
|
||||
#include "../../../zone/blockzonelist.hpp"
|
||||
#include "../../../zone/zoneblocklist.hpp"
|
||||
#include "../../list/blockrailtilelist.hpp"
|
||||
#include "../../list/blockrailtilelisttablemodel.hpp"
|
||||
#include "../../map/blockpath.hpp"
|
||||
@ -569,6 +570,10 @@ void BlockRailTile::destroying()
|
||||
{
|
||||
trains.back()->destroy();
|
||||
}
|
||||
for(const auto& zone : *zones)
|
||||
{
|
||||
zone->blocks->remove(self);
|
||||
}
|
||||
m_world.blockRailTiles->removeObject(self);
|
||||
RailTile::destroying();
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "zoneblocklist.hpp"
|
||||
#include "zonelist.hpp"
|
||||
#include "zonelisttablemodel.hpp"
|
||||
#include "blockzonelist.hpp"
|
||||
#include "../core/attributes.hpp"
|
||||
#include "../core/objectproperty.tpp"
|
||||
#include "../core/objectvectorproperty.tpp"
|
||||
@ -126,6 +127,17 @@ void Zone::addToWorld()
|
||||
m_world.zones->addObject(shared_ptr<Zone>());
|
||||
}
|
||||
|
||||
void Zone::destroying()
|
||||
{
|
||||
auto self = shared_ptr<Zone>();
|
||||
for(const auto& block : *blocks)
|
||||
{
|
||||
block->zones->remove(self);
|
||||
}
|
||||
m_world.zones->removeObject(self);
|
||||
IdObject::destroying();
|
||||
}
|
||||
|
||||
void Zone::fireTrainAssigned(const std::shared_ptr<Train>& train)
|
||||
{
|
||||
fireEvent(onTrainAssigned, train, shared_ptr<Zone>());
|
||||
|
||||
@ -44,6 +44,7 @@ class Zone : public IdObject
|
||||
protected:
|
||||
void worldEvent(WorldState worldState, WorldEvent worldEvent) override;
|
||||
void addToWorld() override;
|
||||
void destroying() override;
|
||||
|
||||
void fireTrainAssigned(const std::shared_ptr<Train>& train);
|
||||
void fireTrainEntering(const std::shared_ptr<Train>& train);
|
||||
|
||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren