Fixed position & direction when copying object from F12 menu
parent
522c54afc3
commit
13ef6e5498
|
@ -83,7 +83,8 @@ CLevelParserParam::CLevelParserParam(Math::Point value)
|
|||
CLevelParserParam::CLevelParserParam(Math::Vector value)
|
||||
{
|
||||
m_array.push_back(MakeUnique<CLevelParserParam>(value.x));
|
||||
m_array.push_back(MakeUnique<CLevelParserParam>(value.y));
|
||||
if(value.y != 0.0f)
|
||||
m_array.push_back(MakeUnique<CLevelParserParam>(value.y));
|
||||
m_array.push_back(MakeUnique<CLevelParserParam>(value.z));
|
||||
|
||||
LoadArray();
|
||||
|
|
|
@ -907,8 +907,10 @@ bool CRobotMain::ProcessEvent(Event &event)
|
|||
{
|
||||
CLevelParserLine line("CreateObject");
|
||||
line.AddParam("type", MakeUnique<CLevelParserParam>(obj->GetType()));
|
||||
line.AddParam("pos", MakeUnique<CLevelParserParam>(obj->GetPosition()));
|
||||
line.AddParam("dir", MakeUnique<CLevelParserParam>(obj->GetRotationZ()/(Math::PI/180.0f)));
|
||||
Math::Vector pos = obj->GetPosition()/g_unit;
|
||||
pos.y = 0.0f;
|
||||
line.AddParam("pos", MakeUnique<CLevelParserParam>(pos));
|
||||
line.AddParam("dir", MakeUnique<CLevelParserParam>(obj->GetRotationY()));
|
||||
|
||||
std::stringstream ss;
|
||||
ss << line;
|
||||
|
|
Loading…
Reference in New Issue