Ticket #897 (closed defect: fixed)

Opened 23 months ago

Last modified 22 months ago

javascript common api

Reported by: lexa Owned by:
Priority: Nice to Have Milestone: Alpha 7
Component: UI & Simulation Keywords: scripting
Cc:

Description

In data/mods/public/simulation/ai/base.js

There seem to be an error at line 90:

this.OnUpdate?();

Should be

this.OnUpdate?(state);

Change History

comment:1 Changed 22 months ago by lexa

Ok, maybe I was wrong Here it says that OnUpdate? takes a message as a parameter... http://svn.wildfiregames.com/docs/writing-components.html

comment:2 Changed 22 months ago by historic_bruno

  • Priority changed from Must Have to Nice to Have

The parameter name doesn't matter in JS, state looks like what we're wanting to call it.

comment:3 Changed 22 months ago by Philip

That's a different OnUpdate for different scripts - AI and component scripts are almost completely independent and unrelated.

common-api is meant to provide a layer of abstraction on top of the state data, so I think it's better not to pass it to OnUpdate at all.

comment:4 Changed 22 months ago by philip

  • Status changed from new to closed
  • Resolution set to fixed

(In [9888]) Fix inconsistent function prototype (fixes #897)

comment:5 Changed 22 months ago by k776

  • Milestone changed from Backlog to Alpha 7
Note: See TracTickets for help on using tickets.