Optimize RandomMagazine() called when deploying to tactical sector (by sun_alf)

Timings
Before:
RandomMagazine: 90044 us (total 90044 us)
RandomMagazine: 90007 us (total 180051 us)
RandomMagazine: 100009 us (total 280060 us)

After:
RandomMagazine: 0 us (total 0 us)
RandomMagazine: 0 us (total 0 us)
RandomMagazine: 0 us (total 0 us)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9354 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Asdow
2022-03-31 15:10:19 +00:00
parent 094c2edbde
commit c334d4a0d4
3 changed files with 17 additions and 22 deletions
+2 -1
View File
@@ -398,7 +398,8 @@ typedef struct
UINT8 ubAmmoType;
UINT8 ubMagType;
UINT32 uiIndex;
// sun_alf: once Magazines.xml is parsed, classIndex of a mag is index in Magazine[], and uiIndex field is not in use anymore,
UINT32 uiIndex; // so let's use it as itemId, i.e. back reference to Item[].
} MAGTYPE;
typedef struct