From d1af36c18916851f893cf61a95fad0a6412265c3 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 20 Oct 2014 09:22:06 +0200 Subject: [PATCH] Point out pitfalls in the Lua API documentation --- OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs | 8 ++++++-- .../Scripting/Properties/ProductionProperties.cs | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs index 9d79d150e9..42f0a22a1b 100644 --- a/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/TriggerGlobal.cs @@ -285,13 +285,17 @@ namespace OpenRA.Mods.RA.Scripting GetScriptTriggers(a).RegisterCallback(Trigger.OnInfiltrated, func, context); } - [Desc("Removes all triggers from this actor.")] + [Desc("Removes all triggers from this actor." + + "Note that the removal will only take effect at the end of a tick, " + + "so you must not add new triggers at the same time that you are calling this function.")] public void ClearAll(Actor a) { GetScriptTriggers(a).ClearAll(); } - [Desc("Removes the specified trigger from this actor.")] + [Desc("Removes the specified trigger from this actor." + + "Note that the removal will only take effect at the end of a tick, " + + "so you must not add new triggers at the same time that you are calling this function.")] public void Clear(Actor a, string triggerName) { var trigger = (Trigger)Enum.Parse(typeof(Trigger), triggerName); diff --git a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs index ed47d59cfd..813dea0e52 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs @@ -145,7 +145,8 @@ namespace OpenRA.Mods.RA.Scripting return true; } - [Desc("Checks whether the factory is currently producing anything on the queue that produces this type of actor.")] + [Desc("Check whether the factory's production queue that builds this type of actor is currently busy." + + "Note: it does not check whether this particular type of actor is being produced.")] public bool IsProducing(string actorType) { if (triggers.Triggers[Trigger.OnProduction].Any()) @@ -249,7 +250,8 @@ namespace OpenRA.Mods.RA.Scripting return true; } - [Desc("Checks whether the player is currently producing anything on the queue that produces this type of actor.")] + [Desc("Check whether the production queue that builds this type of actor is currently busy." + + "Note: it does not check whether this particular type of actor is being produced.")] public bool IsProducing(string actorType) { var queue = GetBuildableInfo(actorType).Queue.First();