Skip to content

Commit

Permalink
Externals: Removed verbose logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ataulien committed Jul 1, 2018
1 parent fa23ae6 commit ddfb952
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 46 deletions.
19 changes: 0 additions & 19 deletions src/logic/scriptExternals/Externals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,16 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor
return pWorld->getScriptEngine().findNPCVobFromScriptInstance(instance);
};

/**
* ta_min
*/
vm->registerExternalFunction("ta_min", [=](Daedalus::DaedalusVM& vm) {
std::string waypoint = vm.popString();
if (verbose) LogInfo() << "waypoint: " << waypoint;

uint32_t action = vm.popDataValue();
int32_t stop_m = vm.popDataValue();
if (verbose) LogInfo() << "stop_m: " << stop_m;
int32_t stop_h = vm.popDataValue();
if (verbose) LogInfo() << "stop_h: " << stop_h;
int32_t start_m = vm.popDataValue();
if (verbose) LogInfo() << "start_m: " << start_m;
int32_t start_h = vm.popDataValue();
if (verbose) LogInfo() << "start_h: " << start_h;
uint32_t arr_self;
int32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation npc = getNPCByInstance(self);

Expand Down Expand Up @@ -106,17 +97,11 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor

vm->registerExternalFunction("printscreen", [=](Daedalus::DaedalusVM& vm) {
int32_t timesec = vm.popDataValue();
if (verbose) LogInfo() << "timesec: " << timesec;
std::string font = vm.popString();
if (verbose) LogInfo() << "font: " << font;
int32_t posy = vm.popDataValue();
if (verbose) LogInfo() << "posy: " << posy;
int32_t posx = vm.popDataValue();
if (verbose) LogInfo() << "posx: " << posx;
std::string msg = vm.popString();
if (verbose) LogInfo() << "msg: " << msg;
int32_t dialognr = vm.popDataValue();
if (verbose) LogInfo() << "dialognr: " << dialognr;

pWorld->getPrintScreenManager().printMessageTimed(posx / 100.0f,
posy / 100.0f,
Expand Down Expand Up @@ -167,7 +152,6 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor
});

vm->registerExternalFunction("mob_hasitems", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "mob_hasitems";
uint32_t iteminstance = (uint32_t)vm.popDataValue();
std::string mobname = vm.popString();

Expand All @@ -186,7 +170,6 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor

vm->registerExternalFunction("createinvitem", [=](Daedalus::DaedalusVM& vm) {
uint32_t itemInstance = (uint32_t)vm.popDataValue();
if (verbose) LogInfo() << "itemInstance: " << itemInstance;
uint32_t arr_n0;
int32_t npc = vm.popVar(arr_n0);

Expand All @@ -206,7 +189,6 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor
vm->registerExternalFunction("createinvitems", [=](Daedalus::DaedalusVM& vm) {
uint32_t num = (uint32_t)vm.popDataValue();
uint32_t itemInstance = (uint32_t)vm.popDataValue();
if (verbose) LogInfo() << "itemInstance: " << itemInstance;
uint32_t arr_n0;
int32_t npc = vm.popVar(arr_n0);

Expand All @@ -217,7 +199,6 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor

vm->registerExternalFunction("hlp_getnpc", [=](Daedalus::DaedalusVM& vm) {
int32_t instancename = vm.popDataValue();
if (verbose) LogInfo() << "instancename: " << instancename;

/*if(!vm.getDATFile().getSymbolByIndex(instancename).instanceDataHandle.isValid())
{
Expand Down
2 changes: 0 additions & 2 deletions src/logic/scriptExternals/Externals_AI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ void ScriptExternals::registerEngineExternals_ai(World::WorldInstance& world, Da
vm->registerExternalFunction("ai_turntonpc", [=](Daedalus::DaedalusVM& vm) {
uint32_t arr_n1;
int32_t target = vm.popVar(arr_n1);
if (verbose) LogInfo() << "target: " << target;
uint32_t arr_n0;
int32_t self = vm.popVar(arr_n0);
if (verbose) LogInfo() << "self: " << self;

if (!isSymInstanceValid(self) || !isSymInstanceValid(target))
return;
Expand Down
22 changes: 0 additions & 22 deletions src/logic/scriptExternals/Externals_Npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
vm->registerExternalFunction("npc_getdisttonpc", [=](Daedalus::DaedalusVM& vm) {
uint32_t arr_npc2;
uint32_t npc2 = vm.popVar(arr_npc2);
if (verbose) LogInfo() << "npc2: " << npc2;
uint32_t arr_npc1;
uint32_t npc1 = vm.popVar(arr_npc1);
if (verbose) LogInfo() << "npc1: " << npc1;

if (!isSymInstanceValid(npc1) || !isSymInstanceValid(npc2))
vm.setReturn(INT32_MAX);
Expand All @@ -66,10 +64,8 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,

vm->registerExternalFunction("npc_getdisttowp", [=](Daedalus::DaedalusVM& vm) {
std::string wpname = vm.popString();
if (verbose) LogInfo() << "wpname: " << wpname;
uint32_t arr_self;
uint32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation vob = getNPCByInstance(self);

Expand Down Expand Up @@ -104,7 +100,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
uint32_t item = vm.popVar();
uint32_t arr_npc;
int32_t npc = vm.popVar(arr_npc);
if (verbose) LogInfo() << "npc: " << npc;

VobTypes::NpcVobInformation npcvob = getNPCByInstance(npc);
Vob::VobInformation itemvob = getItemByInstance(item);
Expand All @@ -126,7 +121,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
vm->registerExternalFunction("npc_getdisttoplayer", [=](Daedalus::DaedalusVM& vm) {
uint32_t arr_npc1;
uint32_t npc1 = vm.popVar(arr_npc1);
if (verbose) LogInfo() << "npc1: " << npc1;

VobTypes::NpcVobInformation vob1 = getNPCByInstance(npc1);
VobTypes::NpcVobInformation vob2 = getNPCByInstance(vm.getDATFile().getSymbolIndexByName("hero"));
Expand All @@ -142,7 +136,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,

vm->registerExternalFunction("npc_isplayer", [=](Daedalus::DaedalusVM& vm) {
uint32_t player = vm.popVar();
if (verbose) LogInfo() << "player: " << player;

VobTypes::NpcVobInformation npc = getNPCByInstance(player);

Expand Down Expand Up @@ -213,10 +206,8 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,

vm->registerExternalFunction("npc_exchangeroutine", [=](Daedalus::DaedalusVM& vm) {
std::string routinename = vm.popString();
if (verbose) LogInfo() << "routinename: " << routinename;
uint32_t arr_self;
uint32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation npc = getNPCByInstance(self);

Expand All @@ -229,7 +220,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
vm->registerExternalFunction("npc_getnearestwp", [=](Daedalus::DaedalusVM& vm) {
uint32_t arr_self;
int32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation npc = getNPCByInstance(self);

Expand All @@ -250,7 +240,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
vm->registerExternalFunction("npc_getnextwp", [=](Daedalus::DaedalusVM& vm) {
uint32_t arr_self;
int32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation npc = getNPCByInstance(self);

Expand Down Expand Up @@ -331,12 +320,9 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
});

vm->registerExternalFunction("npc_setstatetime", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "npc_setstatetime";
int seconds = vm.popDataValue();
if (verbose) LogInfo() << "seconds: " << seconds;
uint32_t arr_self;
int32_t self = vm.popVar(arr_self);
if (verbose) LogInfo() << "self: " << self;

VobTypes::NpcVobInformation npc = getNPCByInstance(self);
npc.playerController->getAIStateMachine().setCurrentStateTime(seconds);
Expand Down Expand Up @@ -427,14 +413,9 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
});

vm->registerExternalFunction("npc_giveitem", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "npc_giveitem";

uint32_t fromNpcId = vm.popVar();
if (verbose) LogInfo() << "from" << fromNpcId;
uint32_t itemInstance = vm.popVar();
if (verbose) LogInfo() << "item" << itemInstance;
uint32_t toNpcId = vm.popVar();
if (verbose) LogInfo() << "to" << toNpcId;

VobTypes::NpcVobInformation fromNpc = getNPCByInstance(fromNpcId);
VobTypes::NpcVobInformation toNpc = getNPCByInstance(toNpcId);
Expand All @@ -449,7 +430,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,

vm->registerExternalFunction("npc_clearinventory", [=](Daedalus::DaedalusVM& vm) {
uint32_t npcId = vm.popVar();
if (verbose) LogInfo() << "npc_clearinventory " << npcId;

VobTypes::NpcVobInformation npc = getNPCByInstance(npcId);

Expand All @@ -476,7 +456,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
});

vm->registerExternalFunction("npc_isinstate", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "npc_isinstate";
uint32_t state = (uint32_t)vm.popVar();
int32_t self = vm.popVar();

Expand All @@ -491,7 +470,6 @@ void ScriptExternals::registerEngineExternals_npc(World::WorldInstance& world,
});

vm->registerExternalFunction("npc_hasequippedmeleeweapon", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "npc_hasequippedmeleeweapon";
int32_t self = vm.popVar();

VobTypes::NpcVobInformation npc = getNPCByInstance(self);
Expand Down
2 changes: 0 additions & 2 deletions src/logic/scriptExternals/Externals_Snd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ void ScriptExternals::registerEngineExternals_snd(World::WorldInstance& world,
using Daedalus::GameState::NpcHandle;

vm->registerExternalFunction("snd_play", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "snd_play";
std::string s0 = vm.popString();
if (verbose) LogInfo() << "s0: " << s0;

pWorld->getAudioWorld().playSound(s0);
});
Expand Down
1 change: 0 additions & 1 deletion src/logic/scriptExternals/Externals_Wld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ void ScriptExternals::registerEngineExternals_wld(World::WorldInstance& world,
});

vm->registerExternalFunction("wld_getday", [=](Daedalus::DaedalusVM& vm) {
if (verbose) LogInfo() << "wld_getday";
vm.setReturn(pWorld->getEngine()->getGameClock().getDay());
});

Expand Down

0 comments on commit ddfb952

Please sign in to comment.