Author Topic: Rusty & Munk's HatMod+  (Read 57516 times)



I think I'll actually get this.

Nice work.

Badspot

  • Administrator
function hatLoop(%client, %ov) calls these lines immediately
Code: [Select]
schedule(1000, 0, syncHatList, %client);
%client.hatLoop = schedule($RMhatmod::LoopTime * 60000, 0, hatLoop, %client);

Then if either $RMHatMod::Loop or $RMHatMod::FH is false it will call the same two lines again, causing a multiplying schedule loop that will eventually lag out the server.  I am forced to fail this add-on by CRC.

Here is one way to avoid this sort of problem: Every time you go to schedule something, store the scheduled event in a variable, then if you want to reschedule it, cancel the old event first.  Like this:

Code: [Select]
if(isEventPending(%client.hatLoop))
{
   cancel(%client.hatLoop);
   %client.hatLoop = 0;
}
%client.hatLoop = schedule($RMhatmod::LoopTime * 60000, 0, hatLoop, %client);

You should do something similar the syncHatList loop and any other schedule loops you are creating.

I am forced to fail this add-on by CRC.

He doesn't get a chance to fix it?

He doesn't get a chance to fix it?

If he modifies the files, the CRC will change. Only the current version is failed.