mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Implement FindRoomNumber and use it elsewhere
This commit is contained in:
parent
cdec61d0ff
commit
82132ae405
9 changed files with 37 additions and 39 deletions
|
@ -367,12 +367,12 @@ void Moveable::Register(sol::table & parent)
|
|||
|
||||
void Moveable::Init()
|
||||
{
|
||||
bool cond = IsPointInRoom(m_item->Pose, m_item->RoomNumber);
|
||||
bool cond = IsPointInRoom(m_item->Pose.Position, m_item->RoomNumber);
|
||||
std::string err{ "Position of item \"{}\" does not match its room ID." };
|
||||
if (!ScriptAssertF(cond, err, m_item->LuaName))
|
||||
{
|
||||
ScriptWarn("Resetting to the center of the room.");
|
||||
PHD_3DPOS center = GetRoomCenter(m_item->RoomNumber);
|
||||
auto center = GetRoomCenter(m_item->RoomNumber);
|
||||
// reset position but not rotation
|
||||
m_item->Pose.Position.x = center.Position.x;
|
||||
m_item->Pose.Position.y = center.Position.y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue