Add TryMoveAlong(distance, angle)

This will take a distance you would like to move and an EQ angle you
would like to move relative to current heading (so 0 is in front, 256
behind)

Exported to Lua as well
This commit is contained in:
Michael Cook (mackal)
2018-03-06 23:03:55 -05:00
parent 7e7f5f0bd6
commit 8f66527e02
4 changed files with 47 additions and 0 deletions
+12
View File
@@ -282,6 +282,16 @@ void Lua_Mob::GMMove(double x, double y, double z, double heading, bool send_upd
self->GMMove(static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), static_cast<float>(heading), send_update);
}
void Lua_Mob::TryMoveAlong(float distance, float angle) {
Lua_Safe_Call_Void();
self->TryMoveAlong(distance, angle);
}
void Lua_Mob::TryMoveAlong(float distance, float angle, bool send) {
Lua_Safe_Call_Void();
self->TryMoveAlong(distance, angle, send);
}
bool Lua_Mob::HasProcs() {
Lua_Safe_Call_Bool();
return self->HasProcs();
@@ -2197,6 +2207,8 @@ luabind::scope lua_register_mob() {
.def("GMMove", (void(Lua_Mob::*)(double,double,double))&Lua_Mob::GMMove)
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double))&Lua_Mob::GMMove)
.def("GMMove", (void(Lua_Mob::*)(double,double,double,double,bool))&Lua_Mob::GMMove)
.def("TryMoveAlong", (void(Lua_Mob::*)(float,float))&Lua_Mob::TryMoveAlong)
.def("TryMoveAlong", (void(Lua_Mob::*)(float,float,bool))&Lua_Mob::TryMoveAlong)
.def("HasProcs", &Lua_Mob::HasProcs)
.def("IsInvisible", (bool(Lua_Mob::*)(void))&Lua_Mob::IsInvisible)
.def("IsInvisible", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsInvisible)