Author Topic: [FIXED] Glamour bug in XPZ got much worse in 7.9.8  (Read 1872 times)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
[FIXED] Glamour bug in XPZ got much worse in 7.9.8
« on: July 12, 2023, 03:03:42 pm »
The old issue was Glamour stockpiling in soldier inventory. Now, after the fix, the situation is much worse: it stockpiles somehow on craft  inventory (seems like every time you use Bikini), gets saved and multiplied with every use of Bikini. Then it gets destroyed on missions as per standard Glamour behaviour, and then it gets sucked up from base storage to restock. The wake-up call was when I suddenly got message 'not enough Glamour to restock craft inventory'. I attach a mission save after ending which this happens. Just end the mission and see for yourself.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Glamour bug in XPZ got much worse in 7.9.8
« Reply #1 on: December 03, 2023, 12:05:31 pm »
I see Glamour assigned on the craft in the provided save.

But I cannot reproduce Glamour getting on the craft when using a fresh save (and latest OXCE).
So maybe the old fix already works... but doesn't fix already corrupted saves.

I will hardcode into the next OXCE release a save-fixing function (destroy all items with 'ignoreInCraftEquip: true' in all crafts when loading a save).


In the meantime, if somebody can try to reproduce this bug on a fresh save, please let me know.
I attach a save I was playing around with, it has $1 billion and several bikini armors already at the base.
« Last Edit: December 03, 2023, 01:19:19 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Glamour bug in XPZ got much worse in 7.9.8
« Reply #2 on: December 03, 2023, 12:13:23 pm »
For potential future use, I'm adding ruleset needed to test this in vanilla.

Code: [Select]
research:
  - name: STR_UNAVAILABLE
    needItem: true

armors:
  - type: STR_PERSONAL_ARMOR_UC
    builtInWeapons:
      - STR_GLAMOUR

items:
  - type: STR_PERSONAL_ARMOR
    costBuy: 100

Code: [Select]
items:
  - type: STR_GLAMOUR
    requires:
      - STR_UNAVAILABLE
    size: 0.001
    costSell: 3000
    weight: 0
    bigSprite: 0
    floorSprite: 0
    clipSize: 1
    isExplodingInHands: true
    recoveryPoints: 12
    recover: true
    battleType: 10
    fuseType: -1
    invWidth: 0
    invHeight: 0
    armor: 133
    specialType: 44
    scripts:
      createItem: |
        var int fuseLength;
        battle_game.randomRange fuseLength 5 28;
        item.setFuseTimer fuseLength;
        return;
    ignoreInBaseDefense: true
    ignoreInCraftEquip: true
    hiddenOnMinimap: true
    listOrder: 15191

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Glamour bug in XPZ got much worse in 7.9.8
« Reply #3 on: December 03, 2023, 01:25:05 pm »
I will hardcode into the next OXCE release a save-fixing function (destroy all items with 'ignoreInCraftEquip: true' in all crafts when loading a save).

Implemented here: https://github.com/MeridianOXC/OpenXcom/commit/e1969355325c586ba863d580d5860c388a7ae7ea

If this happens, there will be log entries like this:

Code: [Select]
[03-12-2023_12-21-36] [WARN] Item 'STR_GLAMOUR' cannot be equipped in the craft inventory (STR_CHARIOT, 1). Skipping 29 items.
[03-12-2023_12-21-36] [WARN] Item 'STR_GLAMOUR' cannot be equipped in the craft inventory (STR_FUEGO, 1). Skipping 78 items.
[03-12-2023_12-21-36] [WARN] Item 'STR_GLAMOUR' cannot be equipped in the craft inventory (STR_GOLDHAWK, 1). Skipping 50 items.