Annoying Issue I can't find

Hey, he’s using Openaura! let’s get him boys! But in all seriousness…


-- Called just after the opaque renderables have been drawn.
function openAura.schema:PostDrawOpaqueRenderables(drawingDepth, drawingSkybox)
	if (!drawingSkybox) then
		local colorWhite = openAura.option:GetColor("white");
		local colorBlack = Color(0, 0, 0, 255);
		local eyeAngles = EyeAngles();
		local curTime = UnPredictedCurTime();
		local eyePos = EyePos();
		
		if (CurTime() >= self.nextGetSnipers) then
			self.nextGetSnipers = CurTime() + 1;
			self.sniperPlayers = {};
			
			for k, v in ipairs( _player.GetAll() ) do
				if ( openAura.player:GetWeaponRaised(v) ) then
					local weapon = v:GetActiveWeapon();
					
					if ( v:HasInitialized() and IsValid(weapon) ) then
						local weaponClass = string.lower( weapon:GetClass() );
						
						if (weaponClass == "rcs_g3sg1" and weapon:GetNetworkedInt("Zoom") != 0) then
							self.sniperPlayers[#self.sniperPlayers + 1] = v;
						end;
					end;
				end;
			end;
			
			if (#self.sniperPlayers == 0) then
				self.sniperPlayers = nil;
			end;
		end;
		
		if (self.sniperPlayers) then
			cam.Start3D(eyePos, eyeAngles);
				for k, v in ipairs(self.sniperPlayers) do
					if ( IsValid(v) and v:Alive() ) then
						local trace = openAura.player:GetRealTrace(v, true);
						local position = trace.HitPos + (trace.HitNormal * 1.25);
						
						render.SetMaterial(self.laserSprite);
						render.DrawSprite( position, 4, 4, Color(255, 0, 0, 255) );
					end;
				end;
			cam.End3D();
		end;
	end;
end;

On line 429 (The first line of code, “function openAura.schema:PostDrawOpaqueRenderables(drawingDepth, drawingSkybox)”)

I get the error: attempt to compare nil with number

What’s wrong? :frowning:

No ideas? :confused:

Have you tried the gm_debugger and see if it tells you anything more about the error?

gm_debugger thread

I’m not sure what could be causing the error, but the debugger may give you another hint.

Thanks, I’ll have a look with that

Are you sure that’s the right line? I don’t see how you can get that error from that line…