#3 Fix for crosslevel with spawnflag 8

game_hcode
closed-accepted
nobody
bugfix (2)
5
2011-01-04
2010-02-21
Keith Rozett
No

The original gamecode has a bug that prevents any crosslevel triggers from working if they use spawnflag 8. This is most noticeable in the original Hexen II, where one of the prizes in the Temple of Mars doesn't appear.

You can test the bug yourself by making a small level with a button that targets a crosslevel trigger using spawnflag 8, and then a separate level with a crosslevel_target trigger attached to something like an item spawner. The spawner will never create the item. But if you use any other spawnflag number, the item spawner will work correctly.

I traced the bug down to subs.hc, which defines a constant SPAWNFLAG_ACTIVATED, with a value of 8. There is a function called InitTrigger, which deactivates the trigger if its spawnflags match this flag... but that shouldn't happen since crosslevel triggers can't be deactivated anyway. I made a lazy fix by setting the inactive property to FALSE on the trigger after calling InitTrigger. This fixes the problem with no ill side-effects, from what I can tell.

Discussion

  • Keith Rozett
    Keith Rozett
    2010-02-21

     
    Attachments
  • Ozkan Sezer
    Ozkan Sezer
    2011-01-04

    The patch is accepted and applied to the svn repository ass of rev. 3867. Sorry that I forgot this one for quite some time. Thank you very much for contributing to uhexen2.

     
  • Ozkan Sezer
    Ozkan Sezer
    2011-01-04

    • status: open --> closed-accepted