Author Topic: DisableScript CrossFunc  (Read 1246 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
DisableScript CrossFunc
« on: April 12, 2008, 12:17:38 pm »
It seems CrossFunc doesn't work on scripts which have DisableScript as true...

tempa
Code: [Select]
procedure EnableMe;
begin
WriteLn('ENABLED DUH SCRIPT');
  DisableScript := false;
end;

procedure ActivateServer();
begin
  DisableScript := true;
end;

procedure AppOnIdle(Ticks: integer);
begin
  WriteLn('I AM RUNNING ' + InttoStr(Ticks));
end;

tempb
Code: [Select]
procedure OnJoinGame(Id, Team: byte);
begin
  CrossFunc([], 'tempa.EnableMe');
end;

when I join the game, apponidle in scripta doesnt start.

Would be cool to have something to support this or to have CrossFunc work in cases like this, sense afterall DisableScript is only supost2 disable calling of events from the server, not calling of any function from another script.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: DisableScript CrossFunc
« Reply #1 on: April 13, 2008, 11:58:41 am »
Not really a bug at all, if you disable your script, all function calls are disabled, thats the whole point of it.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: DisableScript CrossFunc
« Reply #2 on: April 13, 2008, 07:43:38 pm »
Not really a bug at all, if you disable your script, all function calls are disabled, thats the whole point of it.
except by threaded things calling functions within the same script (assuming this is right)

I'll just modify all scripts to have another variable and Enable and Disabling functions, and checks on every event. (A lot of scripts to do that for :()
« Last Edit: April 13, 2008, 07:45:29 pm by DorkeyDear »