God I hate bugs

So I am getting this annoying


ERROR: Trying to derive entity spawned_weapon from non existant entity base_gmodentity!


Anyone know how to fix?

Code please.

http://forum.facepunch.com/showthread.php?t=1047300