Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

lua error #2744

Closed mcNuggets1 closed 8 years ago

mcNuggets1 commented 8 years ago

Details

Lua error

[ERROR] gamemodes/sandbox/entities/effects/selection_ring.lua:45: attempt to compare nil with number

  1. unknown - gamemodes/sandbox/entities/effects/selection_ring.lua:45

    Steps to reproduce

You need to be on a multiplayer server, but exact steps to reproduce I can't give.

robotboy655 commented 8 years ago

It's a problem with that server.

mcNuggets1 commented 8 years ago

How about just check if self.Alpha is a valid number in line 45. I get this Error on normal sandbox servers without modifications either.

Kefta commented 8 years ago

https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/effects/selection_ring.lua#L27

It should always exist if there wasn't any modifications.

Bo98 commented 8 years ago

I've seen the error mentioned before (a couple of people have mentioned it in the Next Update thread) but I have no idea what causes it.

mcNuggets1 commented 8 years ago

Yeah, and who the hell does modify the Alpha of an effect,?

Kefta commented 8 years ago

@mcNuggets1 It's probably a bad addon that doesn't do it intentionally. If this were to happen on a vanilla Sandbox server, or you found something that unintentionally cleared an effect table or caused the Init not to run, THEN it would be an issue.

mcNuggets1 commented 8 years ago

Sorry, but I got no addon which uses the effect or clearly modifies it.

I already stated, that this did happen to me in singleplayer one time without any addons at all.

Kefta commented 8 years ago

Without any steps to replicate, there's not much that can be done

mcNuggets1 commented 8 years ago

There is. Fixing the lua error by checking if alpha is a number.

Kefta commented 8 years ago

Then we should just check if every variable is valid in the engine!

mcNuggets1 commented 8 years ago

No, just things which Could error.

Kefta commented 8 years ago

How could that error unless Init was overrided?

robotboy655 commented 8 years ago

It's not a good idea to start adding excessive validity checks, the underlying issue must be fixed.

mcNuggets1 commented 8 years ago

I dont have an explaination, just a Methode how to fix it.

by the Way I Found the course. it Happens on Using a Tool Gun, but I dont know More than that currently. Oh and that not everytine receives the error.

MStruntze commented 8 years ago

I spoke with someone else about this a few months ago. He said that it was caused by a memory leak in a weapon pack (FAS2) causing gmod to run out of memory or something. It's a common issue for players who've been on one of my servers for 5+ hours.

mcNuggets1 commented 8 years ago

I don't have FAS2 subscribed and it still happens.

MStruntze commented 8 years ago

It was just an example. Might be something else on your end. But since it doesn't happen on all servers, something must be causing it.