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)
|
CLevelParserParam::CLevelParserParam(Math::Vector value)
|
||||||
{
|
{
|
||||||
m_array.push_back(MakeUnique<CLevelParserParam>(value.x));
|
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));
|
m_array.push_back(MakeUnique<CLevelParserParam>(value.z));
|
||||||
|
|
||||||
LoadArray();
|
LoadArray();
|
||||||
|
|
|
@ -907,8 +907,10 @@ bool CRobotMain::ProcessEvent(Event &event)
|
||||||
{
|
{
|
||||||
CLevelParserLine line("CreateObject");
|
CLevelParserLine line("CreateObject");
|
||||||
line.AddParam("type", MakeUnique<CLevelParserParam>(obj->GetType()));
|
line.AddParam("type", MakeUnique<CLevelParserParam>(obj->GetType()));
|
||||||
line.AddParam("pos", MakeUnique<CLevelParserParam>(obj->GetPosition()));
|
Math::Vector pos = obj->GetPosition()/g_unit;
|
||||||
line.AddParam("dir", MakeUnique<CLevelParserParam>(obj->GetRotationZ()/(Math::PI/180.0f)));
|
pos.y = 0.0f;
|
||||||
|
line.AddParam("pos", MakeUnique<CLevelParserParam>(pos));
|
||||||
|
line.AddParam("dir", MakeUnique<CLevelParserParam>(obj->GetRotationY()));
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << line;
|
ss << line;
|
||||||
|
|
Loading…
Reference in New Issue