Trying to access variables from within a struct that's too big to do it directly, so having to use a function. It compiles fine, but I'm not too sure it's actually working. I'd use a debug to find out, but it'd have to be after the return, so would do nothing. Can anyone see anything wrong with this? Thanks in advance.
I'll post the entire mod code next time, if that helps.
Trying to set an int inside an array inside a struct, with MPCS being the other class:
- Code: Select all
MPCS.SetCondition(talkingto, MissionNumber, Interactions[MPCS.GetMissionCondition(TalkingTo, MissionNumber)].E_SetMissionCondition);
Function from the other class (MPCS) ... (paranoid the return; actually stops it - not too sure how it works)
- Code: Select all
struct Storagez
{
Var DeusExPlayer DXP;
var int Condition[40];
};
var() localized Storagez StoredVars[40];
...
function SetCondition(DeusExPlayer DEP, int MissionNumbah, int ChangeTo)
{
local int i;
for (i=1; i<40; i++)
{
if(StoredVars[i].DXP == DEP)
{
StoredVars[i].Condition[MissionNumbah] = ChangeTo; //not sure this is being set
}
}
}