Update plugins

This commit is contained in:
Jackz 2023-07-20 20:15:44 -05:00
parent cc9eb7d9d4
commit 52c3d04c89
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
25 changed files with 2163 additions and 870 deletions

View file

@ -4,7 +4,7 @@
//Allow MAX_TROLLS to be defined elsewhere
#if defined MAX_TROLLS
#else
#define MAX_TROLLS 49
#define MAX_TROLLS 50
#endif
enum trollModifier {
@ -123,7 +123,9 @@ enum struct Troll {
}
int AddFlag(const char[] name, bool defaultOn) {
if(this.flagNames == null) this.flagNames = new ArrayList(MAX_TROLL_FLAG_LENGTH);
if(this.flagNames == null) {
this.flagNames = new ArrayList(MAX_TROLL_FLAG_LENGTH);
}
// Check if flag already added
int flagIndex = this.GetFlagIndex(name);
@ -131,8 +133,13 @@ enum struct Troll {
// Grab the prompt
static TrollFlagPrompt prompt;
// TODO: CHECK IF MISSING PROMPT
if(g_trollAddPromptIndex >= this.flagPrompts.Length) {
ThrowError("No prompt added for troll \"%s\", for flag \"%s\"", this.id, name);
}
this.flagPrompts.GetArray(g_trollAddPromptIndex, prompt);
prompt.flags |= (1 << flagIndex);
if(defaultOn) {