Jump to content
  • 0

player_zombieAttack maybe a logic failure?


ViseVersa

Question

Hi,

i was currently working on rewriting the player_zombieCheck.sqf to a more nicer and faster Version, when i encountered a weired thing. Inside the script, the player_zombieAttack.sqf is called ([_x, "zombie"] spawn player_zombieAttack;) so i looked into the File and noticed a few things.


First of all this is the only instance, where zombieAttack is called, so the type is allways "zombie" and could be taken out. I'm guessing they wanted to make dogs attack things to, but never completed it. The second thing is -

if (!dayz_zedsAttackVehicles && !(_vehicle in _targets)) exitWith { 
	//diag_log ("not attacking vehicle" + str(_vehicle));  
};

 

Now the first bit is clear, it's a variable, that you can set in variables.sqf to determine, if zombies should be attacking a vehicle or not. But the second bit i'm confused from. "!vehicle in targets" - This yeah ok it means, that the vehicle should not be in the target list, but then again in the zombie Check it will add the vehicle to the target no matter what. So basically this means that the if is failing, because when the vehicle is NOT in the targets (which it is!) the script will exit.

 

Honestly, this is melting my brain.

I`m thinking about it like this if the vehicle is in targets it will return true, but the script will only exit, if it returns false, am i right? So this means, that if the vehicle is in targets the script won't exit and the zombie is still gonna attack the vehicle or not? I`m thinking, that the whole second part shouldn't even be in there, so it should look like:

 

if (!dayz_zedsAttackVehicles) exitWith { 
	//diag_log ("not attacking vehicle" + str(_vehicle));  
};

 

I need help understanding this. Is my conclusion correct or not?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...