View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-08-2018 , 11:30   Re: [L4D2] Ammo Pack Deployers
Reply With Quote #8

Quote:
Originally Posted by cravenge View Post
Those errors are harmless, but I assure you that the plugin will still work. I'm kinda working it out on figuring what causes them to pop out and why.
You're not checking whether it is a valid entity:

Code:
public void OnEntityCreated(int entity, const char[] classname)
{
	if (entity < 1 || entity > 2048)
	{
		return;
[...]
vs

Code:
public void OnEntityDestroyed(int entity)
{
	if (IsAmmoPack(entity) && !IsAmmoPackOwned(entity))
	{
[...]
Adding some check in OnEntityDestroyed before blindly using "entity" might fix it.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline