2025-07-25 18:17 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003934Spring engineGeneralpublic2013-08-13 01:43
Reporterikinz 
Assigned Toabma 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version94.1.1+git 
Target Version95.0Fixed in Version 
Summary0003934: unitsync: GetPrimaryModIndex() always returns -1
DescriptionAt least since 94.1.1-875-g4e58b8b GetPrimaryModName() fails for all installed mods with an exception of ZK missions.

Likely solution:

https://github.com/spring/spring/commit/a813447139a01deede046723db1194c929f8704c changed GetName() to GetNameVersioned() in GetPrimaryModName(). I assume the same change is needed in GetPrimaryModIndex().
Steps To Reproduceint i;
Init(0, 0);
int count = GetPrimaryModCount();
printf("mod count: %i\n", count);
for(i = 0; i < count; i++)
    printf("mod index for %s (%i): %i\n", GetPrimaryModName(i), i, GetPrimaryModIndex(GetPrimaryModName(i)));

====

mod count: 14
mod index for Air Force Command r93 (0): 0
mod index for Asteroid Mining r152 (1): 1
mod index for Evolution RTS - test-604 (2): -1
mod index for Evolution RTS - test-611 (3): -1
mod index for Evolution RTS - v6.42 (4): -1
mod index for Tutorial - Running Start r177 (5): 5
mod index for Zero-K test-11020 (6): -1
mod index for Zero-K test-11021 (7): -1
mod index for Zero-K test-11022 (8): -1
mod index for Zero-K test-11024 (9): -1
mod index for Zero-K test-11092 (10): -1
mod index for Zero-K v1.1.7.7 (11): -1
mod index for Zero-K v1.1.8.0 (12): -1
mod index for Zero-K v1.1.8.1 (13): -1
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0011301

ikinz (reporter)

>At least since 94.1.1-875-g4e58b8b GetPrimaryModName() fails for all installed mods with an exception of ZK missions.
Looks like I can't edit the issue. I meant GetPrimaryModIndex().

~0011303

abma (administrator)

https://github.com/spring/spring/blob/develop/tools/unitsync/unitsync.cpp#L1471

~0011304

abma (administrator)

GetPrimaryModName() is deprecated! don't use it!

https://github.com/spring/spring/blob/develop/tools/unitsync/unitsync_api.h#L1251
+Notes

-Issue History
Date Modified Username Field Change
2013-08-12 17:04 ikinz New Issue
2013-08-12 17:18 ikinz Note Added: 0011301
2013-08-12 17:41 abma Target Version => 95.0
2013-08-12 17:43 abma Note Added: 0011303
2013-08-12 20:58 abma Assigned To => abma
2013-08-12 20:58 abma Status new => assigned
2013-08-13 01:42 abma Changeset attached => spring develop 1931f00c
2013-08-13 01:42 abma Status assigned => resolved
2013-08-13 01:42 abma Resolution open => fixed
2013-08-13 01:43 abma Note Added: 0011304
+Issue History