henricj / dunelegacy

GNU General Public License v2.0
27 stars 5 forks source link

SCENA008.INI:108: Invalid drop time string: '20+' #45

Closed juj closed 2 years ago

juj commented 2 years ago

When playing Atreides mission 4 (other missions print that error as well), there are the following errors in the log:

INFO    :   SCENA008.INI:108: Invalid drop time string: '20+'!
INFO    :   SCENA008.INI:109: Invalid drop time string: '20+'!
INFO    :   SCENA008.INI:110: Invalid drop time string: '20+'!
INFO    :   SCENA008.INI:111: Invalid drop time string: '20+'!

After Atreides level 4, there is a cutscene where Emperor says that Harkonnen was unable to beat the player even with the help of Sardaukar. However during that level, there never were any Sardaukar troops. I wonder if that might be correlated with that error message.

henricj commented 2 years ago

That should mean repeating every N minutes..?

https://sourceforge.net/projects/dunelegacy/files/modding//Dune II Scenario Format Specification.pdf

juj commented 2 years ago

The code in

https://github.com/henricj/dunelegacy/blob/b167e1127590c55760c0b5a4d2d24915e316b60f/src/INIMap/INIMapLoader.cpp#L794-L800

seems to want to state that a valid repeating/recurring reinforcement string would be either of form

3=Sardaukar,Troopers,Enemybase,20+

or

3=Sardaukar,Troopers,Enemybase,20,+

This second syntax reads to me quite peculiar. However I cannot really contest if that was really the design, but this does make me suspect whether the code has been some kind of brain fog where the author was thinking "the plus at the end of the last number s optional, so parse in two different ways".

Git blaming does take that logic all the way to the original commit

Revision: 555c45c09be4033c26dc71b13f689d880d2fbe75
Author: Richard Schaller <richard.schaller@gmx.de>
Date: 02/03/2013 19.20.45
Message:
Initial commit (Dune Legacy 0.96.3)

where the logic was already the same, and read

        if(splitString(iter->getStringValue(), 4, &strHouseName, &strUnitName, &strDropLocation, &strTime) == false) {
            if(splitString(iter->getStringValue(), 5, &strHouseName, &strUnitName, &strDropLocation, &strTime, &strPlus) == false) {
                logWarning(iter->getLineNumber(), "Invalid reinforcement string: " + iter->getKeyName() + " = " + iter->getStringValue());
                continue;
            }
        }

Reading the PDF document does not mention anything about this optional , + syntax, but just about the <number> or <number>+, so not sure what's up there.

I'll be daring and assume that this was some kind of bug, and stop parsing the , + syntax altogether.