Frictional Games Forum (read-only)
If with empty statement - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: If with empty statement (/thread-16009.html)



If with empty statement - FlawlessHappiness - 06-09-2012

i made an if statement, which should be all right

void OnStart()
{

SetEntityConnectionStateChangeCallback("lever_simple01_1", "PipeStart1_1");
SetEntityConnectionStateChangeCallback("lever_simple01_2", "PipeStart1_2");
}


void PipeStart1_1(string &in asEntity, int alState)
{
if(alState == 1)
{
AddLocalVarInt("PipeStart1", 1);

if(GetLocalVarInt("PipeStart1") == 2);
{
AddPlayerSanity(5.0f);
}
}
}

void PipeStart1_2(string &in asEntity, int alState)
{
if(alState == 1)
{
AddLocalVarInt("PipeStart1", 1);

if(GetLocalVarInt("PipeStart1") == 2);
{
AddPlayerSanity(5.0f);
}
}
}

But i get this error which i doesn't understand...

"If with empty statement"


What does this mean?


RE: If with empty statement - Apjjm - 06-09-2012

you have a semi-colon after your if statements:

if(GetLocalVarInt("PipeStart1") == 2);


You will need to remove that.


RE: If with empty statement - FlawlessHappiness - 06-09-2012

Dangit! Thank you! It works!