Access Nones caused by Patroling's TakeDamage

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2803
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Access Nones caused by Patroling's TakeDamage

Post by Barbie »

Recently a map was running without players for several hours and I got thousands of Access Nones:
ucc.init.log wrote:ScriptedMale MH-Baikal_V2.ScriptedMale70 (Function UnrealShare.ScriptedPawn.Patroling.TakeDamage:0038) Accessed None
I'm quite sure that the stock ScriptedPawn's code is responsible for it:

Code: Select all

class ScriptedPawn extends Pawn abstract;
[...]
State Patroling
{
	function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, 
						Vector momentum, name damageType)
	{
		Global.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType);
		if ( health <= 0 )
			return;
		LastSeenPos = Enemy.Location;
[...]
If the last code line is executed and Enemy==None, a ScriptWarning Accessed None will be issued then.

Now I was interested in, where that ScriptedMale70 can take damage, although no players were online? I guess its the place in the map, where the ScriptedMales do a jump and accidentally land on ScriptedMale70's (or others) head.
:loool: (I've taken a short video of that).

But now to the point: How to avoid these repeated Accessed None's that flood the log files? Removing Order='Patroling' is not an option, and I really do not want to recode ScriptedPawn and all its sub classes...
<EDIT 2016-05-14>
Spell fixes
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Access Nones caused by Patroling's TakeDamage

Post by Higor »

ScriptedPawn is going to need a major revamp in XC_Engine... more likely for v18 because v17 will be out once the live stability tests are done (it's been live on UnrealKillers' Siege for a week now)
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Access Nones caused by Patroling's TakeDamage

Post by sektor2111 »

Then Checkout
- State Guarding - the same;
- State AlarmPaused...;
- and so on...
Someone was setting up "return" - unhealthy, I just figured that such codes need wrappers not returns.
Post Reply