Search found 11 matches

by silverj
Tue Mar 05, 2019 8:40 am
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Re: Me.SpellReady always returns valid indexing

I see I did not manage to explain it clearly enough to be understood. But it is fine, as I worked around it. But how do I upload a plugin with a few dozen source files into the builder? It says to upload .cpp files, but I have both c/cpp and the project file. I tried to upload a zip, but it says onl...
by silverj
Tue Mar 05, 2019 1:03 am
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Re: Me.SpellReady always returns valid indexing

Actually, you chose inconsistently, some places they return data not present (C++ return false) to get a scripting NULL, while other places they return data present with a FALSE/0 value. This is not maintainability/readability/other excuse in my eyes - but of course it is not my code, so my eyes lie...
by silverj
Mon Mar 04, 2019 3:00 pm
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Re: Me.SpellReady always returns valid indexing

So which spell is not ready when you index with "" ? I made lua (a scripting language) interface for mq2, and these empty indices returning a number are special cases, that break the ordinary indexing chain, that would work with everything else, except the few MQ2CharacterType members that...
by silverj
Mon Mar 04, 2019 5:51 am
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Re: Me.SpellReady always returns valid indexing

I guess it would be best to retain the any real index returns a value, so a better fix for SpellReady would also be to just change the default return from true to false, and return true at the end of the had-an-index path.
by silverj
Mon Mar 04, 2019 5:43 am
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Re: Me.SpellReady always returns valid indexing

Same for Me.AltAbilityReady, to fix return false at around line 3534 instead of true. If this is intended behaviour, I would propose rather only returning false for empty indices, if there are scripts that depend on the return being FALSE for non-existant things, rather than the NULL that I would pe...
by silverj
Mon Mar 04, 2019 5:33 am
Forum: MQ2::Bug Reports
Topic: Me.SpellReady always returns valid indexing
Replies: 8
Views: 2786

Me.SpellReady always returns valid indexing

Even when no spell was matched. To correct, add return false; to around line 3918 in MQ2DataTypes.cpp, so it looks like: for (unsigned long nGem = 0; nGem < NUM_SPELL_GEMS; nGem++) { if (PSPELL pSpell = GetSpellByID(GetMemorizedSpell(nGem))) { if (!_stricmp(GETFIRST(), pSpell->Name)) { if (((PCDISPL...
by silverj
Fri Mar 01, 2019 3:13 am
Forum: MQ2::Bug Reports
Topic: Plugin DLL loader does not try the mq2 folder for dependent dll's
Replies: 1
Views: 1038

Re: Plugin DLL loader does not try the mq2 folder for dependent dll's

And so you would not need to go and read through the mostly erroneous and outdated Windows documentation, the name of the function may be a little misleading, it does not really set the full dll load path, it only adds a single, process-wide additional search path to each following LoadLibrary/LoadL...
by silverj
Fri Mar 01, 2019 3:10 am
Forum: MQ2::Bug Reports
Topic: Plugin DLL loader does not try the mq2 folder for dependent dll's
Replies: 1
Views: 1038

Plugin DLL loader does not try the mq2 folder for dependent dll's

Failing to load plugins that would use dll dependencies. When this is fixed, plugins could use standard shared libraries to optimize size or whatever. I am writing a plugin to allow writing lua scripts instead of the mq2 custom scripting language, and that plugin uses the actual lua language from an...
by silverj
Mon Sep 25, 2017 3:11 am
Forum: MQ2::Bug Reports
Topic: MAXTURBO is too low
Replies: 3
Views: 489

MAXTURBO is too low

Current computers are powerful enough to run heavy scripting; having MAXTURBO at a low number of commands is no longer necessary. I normally run heavy scripts that have 200-300 commands per pass, and peak to thousands without any performance issues. I would recommend increasing MQ2MacroCommands.cpp:...
by silverj
Mon Sep 25, 2017 3:07 am
Forum: MQ2::Bug Reports
Topic: #event always delays when triggered (+fix)
Replies: 7
Views: 1889

#event always delays when triggered (+fix)

To fix, at the end of MQ2MacroCommands.cpp:DoEvents, change bRunNextCommand = FALSE to TRUE. I wrote macros to calculate DPS (I am sure there are plugins that do better at it, and would not hit this issue, but I like the hard way), and noticed it can take seconds to parse heavy melee with #event; al...
by silverj
Mon Sep 25, 2017 2:58 am
Forum: MQ2::Bug Reports
Topic: delay with initial condition passing still delays (+fix)
Replies: 1
Views: 428

delay with initial condition passing still delays (+fix)

To fix this, I checked for the initial delay condition already in MQ2MacroCommands.cpp:Delay, by adding to the end of the function: if (gDelayCondition[0]) { CHAR szCond[MAX_STRING]; strcpy_s(szCond, gDelayCondition); ParseMacroParameter(GetCharInfo()->pSpawn, szCond); DOUBLE Result; if (!Calculate(...