HijackContractManager
Module: hijackcontractmanager.lua
Overview
The HijackContractManager module is responsible for managing active hijack contracts in the game. It provides functions to set an active contract, complete it, and cancel it.
Inheritance
- Inherits from: none β base/utility module
- Imports: none
Instance pattern
Stateless singleton module β no OnActivate/Awake/Create/setmetatable, no uGuid keying. It holds exactly one piece of global state, a single active contract (not per-instance, not a table of contracts):
_oContract: the currently active contract object (whatever table was last passed toSetActiveContract). Only one contract can be tracked at a time β setting a new one silently discards the reference to any previous one, with no cleanup call made on it.
Functions
SetActiveContract(oContract)
Sets _oContract = oContract. Logs a debug message. Called externally from src/vz/pmccon004.lua:92 (HijackContractManager.SetActiveContract(self)), confirming this is used by at least one mission/contract script in the corpus.
CompleteActiveContract()
Calls _oContract:Complete(). Logs a debug message. No confirmed call site found anywhere in the decompiled corpus β canβt confirm from static reading alone whether/how this gets invoked (possibly native/engine-triggered, or simply unused in the shipped content).
CancelActiveContract()
Calls _oContract:Cancel(). Logs a debug message. Called externally from src/vz/pmccon004.lua:506 (HijackContractManager.CancelActiveContract()).
Events
None β no Event.* reference anywhere in this file.
Notes for modders
SetActiveContract/CancelActiveContractare confirmed used bysrc/vz/pmccon004.lua, a contract/mission script β thatβs the concrete example to look at for calling convention._oContractmust implement:Complete()and:Cancel()methods forCompleteActiveContract/CancelActiveContractto work; calling either when_oContractisnil(i.e., beforeSetActiveContracthas ever run) will error.- The module only tracks one contract globally β calling
SetActiveContractagain before the current contract completes/cancels overwrites_oContractwith no warning or cleanup of the old reference.