Page MenuHomeFeedback Tracker

NULL Pointer
New, UrgentPublic

Description

Hi,

Could you please clarify on why this piece of code is throwing a NULL Pointer via ItemBase.

	override void OnRPC( PlayerIdentity sender, int rpc_type,ParamsReadContext ctx )
	{
		super.OnRPC( sender, rpc_type,ctx );
		
		switch(rpc_type)
		{
			#ifndef SERVER
			case CZ_RPCclient.RPC_SYNC_EXPLOSIONROCKET:
				
				m_RocketEffect.Stop();
				m_RocketEffect = NULL;
				Particle.PlayInWorld( ParticleList.EXPLOSION_ROCKET, GetPosition() );
				m_LightExp = RocketBTR4ELight.Cast( ScriptedLightBase.CreateLight( RocketBTR4ELight, GetPosition()) );

			break;
				
			case CZ_RPCclient.RPC_SYNC_SHOTROCKET:
				
				ref Param4<RocketBTR4E,CarScript,vector,vector> ctxParamsSync;
				if (ctx.Read( ctxParamsSync ))
				{
					m_LightActive = RocketBTR4ELightActive.Cast( ScriptedLightBase.CreateLight( RocketBTR4ELightActive, GetPosition()) );
					m_LightActive.AttachOnObject(this, m_LightLocalPosition, m_LightLocalOrientation);
					m_RocketEffect = Particle.PlayOnObject( ParticleList.ROCKET_PART_HELI, this, GetMemoryPointPos("part_pos"), GetOrientation()+ "180 0 0" );	
						
					CZCombatVehicles p_BTR4E = CZCombatVehicles.Cast(ctxParamsSync.param2);
					vector rocket_begin_point = ctxParamsSync.param3;
					vector turret_begin_point = ctxParamsSync.param4;
						
					m_LightActiveShot = RocketBTR4ELightActive.Cast( ScriptedLightBase.CreateLight( RocketBTR4ELightActive, rocket_begin_point ));
					Particle.PlayInWorld(ParticleList.SHOT_TANK, turret_begin_point);
					GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( OffLight, 100, false );
					p_BTR4E.PlaySoundSet(m_RocketSound, SOUND_ROCKET, 0, 0);	
				}
					
			break;
			#endif
		}

		if ( GetWrittenNoteData() )
		{
			GetWrittenNoteData().OnRPC( sender, rpc_type,ctx );
		}
	}

Can not seem to wrap my head around why its throwing NULL Pointers and even crashing someone?

Details

Severity
Crash
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Callatic created this task.Nov 1 2022, 7:08 PM