Here some code example to illustrate:
func void FADEOUTFINISH() {
var OCNPC HER; <---- OCNPC!
if (FF_ACTIVE(FADESCREENTOBLACKLOOP)) {
FF_REMOVE(FADESCREENTOBLACKLOOP);
};
FADESCREENSTATE = 0;
SCREENFADED = TRUE;
if (FADESCREENWORLDCHANGE) {
HER = HLP_GETNPC(HERO); <----- implicit cast!
HER.BITFIELD[0] = HER.BITFIELD[0] & ~OCNPC_BITFIELD0_MOVLOCK;
....
FADESCREENCHANGEWORLD();
};
};
or
func void TELEPORTHEROTOPOS(var int X, var int Y, var int Z) {
var OCNPC HER;
HER = HLP_GETNPC(HERO);
HER._ZCVOB_TRAFOOBJTOWORLD[3] = X;
HER._ZCVOB_TRAFOOBJTOWORLD[7] = Y;
HER._ZCVOB_TRAFOOBJTOWORLD[11] = Z;
};
Keeping discussion open for now; however my current idea is to:
- implement type-check for 'default' VM mode - it should throw exception, if
C_Npc is assigned to OCNPC or any other non-compatible type.
- have 'special' mode, when instead of exception callback is called. It's reproducibility of callback to handle conversion. In those examples fro
npc to zenkit::DaedalusTransientInstance and vise-versa.
Here some code example to illustrate:
or
Keeping discussion open for now; however my current idea is to:
C_Npcis assigned toOCNPCor any other non-compatible type.npctozenkit::DaedalusTransientInstanceand vise-versa.