From 028a5735c5f98aa10718c94de07d2f4b4c1fa6b3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 29 Sep 2021 23:17:03 +0100 Subject: Spectation: add dedicated pathway for spectator mode (#5303) * Spectation: add dedicated pathway for spectator mode + Sync player rotation with spectated entity. + Add dedicated infrastructure to cPlayer for handling spectation, instead of misusing entity riding. * Avoid infinite recursion when exiting spectation, fixes #5296 * AttachTo: Change parameter to reference --- src/Mobs/Pig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Mobs/Pig.cpp') diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp index 1ce6c01fb..88f3795c1 100644 --- a/src/Mobs/Pig.cpp +++ b/src/Mobs/Pig.cpp @@ -67,8 +67,8 @@ void cPig::OnRightClicked(cPlayer & a_Player) m_Attachee->Detach(); } - // Attach the player to this pig - a_Player.AttachTo(this); + // Attach the player to this pig: + a_Player.AttachTo(*this); } else if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE) { -- cgit v1.2.3