Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
function is_tool_allowed
#2
bitte die scneario_base aus r6305 nehmen Smile oder alternativ folgende Zeilen rein bauen:

Code:
function is_tool_allowed(pl, tool_id, wt)
{
    if (pl == 1) return true
    return scenario.forbidden_tools.find( tool_id )==null; // null => not found => allowed
}

Das Problem war, dass find(tool_add_city) 0 zurueck gab, man muss aber auf 'null' testen ...
Zitieren


Nachrichten in diesem Thema
function is_tool_allowed - von ny911 - 30-01-2013, Wednesday-22:42:02
RE: function is_tool_allowed - von Dwachs - 30-01-2013, Wednesday-23:23:01
[Kein Betreff] - von ny911 - 31-01-2013, Thursday-19:02:05

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste