void cHorse::PlayerOpenWindow(cPlayer & a_Player) { auto Window = GetWindow(); if (Window == nullptr) { Window = new cHorseWindow(*this); OpenWindow(Window); } a_Player.OpenWindow(*Window); }
void cMinecartWithChest::OnRightClicked(cPlayer & a_Player) { // If the window is not created, open it anew: cWindow * Window = GetWindow(); if (Window == nullptr) { OpenNewWindow(); Window = GetWindow(); } // Open the window for the player: if (Window != nullptr) { if (a_Player.GetWindow() != Window) { a_Player.OpenWindow(Window); } } }