<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39451 >

I looked at this one, and it is hard.

The C API for emitting signals uses the varargs script_signal_emit, and
specifies type for each argument etc.

I was trying to get a script wrapper for this that would both type check
the arguments to the signal before emitting, and then passing the list
of "dynamically-typed" arguments from Lua to C. I can't figure out how
to do any of those two problems.

A simpler workaround would be for us to provide static copies, a
function for each possible sent signal, like for example:

signal.emit.tech_researched(Tech_Type *t, Player *p, enum tech_reason

etc for each signal. 

As a third option, we could make more abstract functions for giving
techs etc so that it would not be necessary to initiate signals in the
code; really if a tech is given in a scenario script, the side effects
(signals etc) should be so fundamental that we shouldn't need to send
the signals manually.

Freeciv-dev mailing list

Reply via email to