Skip to content
Permalink
Browse files

Add more script timer debug output

  • Loading branch information
dscharrer committed Nov 21, 2013
1 parent b93ae06 commit 7bdfb5320f5f5fd0810af41101c367545d3cbea6
Showing with 13 additions and 4 deletions.
  1. +8 −0 src/script/Script.cpp
  2. +5 −4 src/script/ScriptedLang.cpp
@@ -1755,6 +1755,7 @@ long ARX_SCRIPT_CountTimers() {
//*************************************************************************************
void ARX_SCRIPT_Timer_ClearByNum(long timer_idx) {
if(scr_timer[timer_idx].exist) {
LogDebug("clearing timer " << scr_timer[timer_idx].name);
scr_timer[timer_idx].name.clear();
ActiveTimers--;
scr_timer[timer_idx].exist = 0;
@@ -1910,6 +1911,10 @@ void ARX_SCRIPT_Timer_Check() {
}
}

#ifdef ARX_DEBUG
std::string name = st->name;
#endif

if(st->times == 1) {
ARX_SCRIPT_Timer_ClearByNum(i);
} else {
@@ -1920,7 +1925,10 @@ void ARX_SCRIPT_Timer_Check() {
}

if(es && ValidIOAddress(io)) {
LogDebug("running timer \"" << name << "\" for entity " << io->idString());
ScriptEvent::send(es, SM_EXECUTELINE, "", io, "", pos);
} else {
LogDebug("could not run timer \"" << name << "\" - entity vanished");
}

}
@@ -390,6 +390,7 @@ class SendEventCommand : public Command {

Entity * t = entities.getById(target, io);
if(!t) {
DebugScript(": target does not exist");
EVENT_SENDER = oes;
return Failed;
}
@@ -850,19 +851,17 @@ void timerCommand(const string & timer, Context & context) {

string command = context.getWord();

DebugScript(' ' << options << ' ' << command);

Entity * io = context.getEntity();

if(command == "kill_local") {
DebugScript(' ' << options << " kill_local");
DebugScript(" kill_local");
ARX_SCRIPT_Timer_Clear_All_Locals_For_IO(io);
return;
}

ARX_SCRIPT_Timer_Clear_By_Name_And_IO(timername, io);
if(command == "off") {
DebugScript(' ' << options << " off");
DebugScript(timername << " off");
return;
}

@@ -873,6 +872,8 @@ void timerCommand(const string & timer, Context & context) {
millisecons *= 1000;
}

DebugScript(timername << ' ' << options << ' ' << count << ' ' << millisecons);

size_t pos = context.skipCommand();

long num = ARX_SCRIPT_Timer_GetFree();

0 comments on commit 7bdfb53

Please sign in to comment.
You can’t perform that action at this time.