1
0

Fixes problems with windows:

- Changed cPlayer:OpenWindow to accept a ref, tolua adds a nil check
- Close open lua window in destructor, to avoid dangling pointers
This commit is contained in:
Lukas Pioch
2017-05-29 21:33:30 +02:00
parent 2b699dc749
commit 7922e6addb
15 changed files with 39 additions and 18 deletions

View File

@@ -297,7 +297,7 @@ bool cBeaconEntity::UsedBy(cPlayer * a_Player)
// if (a_Player->GetWindow() != Window)
// -> Because mojang doesn't send a 'close window' packet when you click the cancel button in the beacon inventory ...
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}
return true;

View File

@@ -65,7 +65,7 @@ bool cBrewingstandEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}

View File

@@ -101,7 +101,7 @@ bool cChestEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}

View File

@@ -153,7 +153,7 @@ bool cDropSpenserEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}
return true;

View File

@@ -66,7 +66,7 @@ bool cEnderChestEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}
return true;

View File

@@ -69,7 +69,7 @@ bool cFurnaceEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}

View File

@@ -95,7 +95,7 @@ bool cHopperEntity::UsedBy(cPlayer * a_Player)
{
if (a_Player->GetWindow() != Window)
{
a_Player->OpenWindow(Window);
a_Player->OpenWindow(*Window);
}
}