1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

only spawn/lookup house instance if player chooses to enter

This commit is contained in:
NotAdam 2018-12-02 18:50:06 +11:00
parent e290febcc4
commit 394d8e2b28

View file

@ -23,6 +23,10 @@ public:
player.playScene( eventId, 0, 0, [this, eobj]( Entity::Player& player, const Event::SceneResult& result )
{
// param2 == 1 when player wants to enter house
if( result.param2 != 1 )
return;
auto terriMgr = getFramework()->get< Sapphire::World::Manager::TerritoryMgr >();
if( !terriMgr )
return;
@ -43,10 +47,6 @@ public:
player.sendDebug( "created zone with guid: " + std::to_string( internalZone->getGuId() ) + "\nname: " + internalZone->getName() );
}
// param2 == 1 when player wants to enter house
if( result.param2 != 1 )
return;
player.eventFinish( result.eventId, 1 );
player.setPos( { 0.f, 0.f, 0.f } );