gmod_game: Fixed material tool changing the material clientsi..

Revision 804
Fixed material tool changing the material clientside even it was disallowed.
Removed useless GamemodeVoteDebug console command from Fretta.
Added __index meta method to index individual characters of strings.
Replaced calls to both Panel.GetWide and Panel.GetTall with a single call to Panel.GetSize.
Changed Files:
Committed By Alexander Overvoorde

[lua\vgui\dnumberwang.lua:321] attempt to perform arithmetic on local ‘Value’ (a string value)

Does that when trying to change the slider on some tools in the svn version of gmod.

you can’t do arithmetic to a string
if the string contains numbers do tostring(Value)

It happens for vanilla tools too and this isn’t the first update to have this problem. Time to do some digging.

Edit: It was definitely something in revision 781 that caused it. No idea what yet though.
Edit 2: Haha what, it’s caused by string.Trim. What the hell.
Edit 3: I cried a bit

[lua]function PANEL:SetValue( val )

if ( val == nil ) then return end

local OldValue = val
val = tonumber( val )
val = val or 0

if ( self.m_iDecimals == 0 ) then

	val = Format( "%i", val )

elseif ( val != 0 ) then

	val = Format( "%."..self.m_iDecimals.."f", val )
	// Trim trailing 0's and .'s 0 this gets rid of .00 etc
	val = string.TrimRight( val, "0" )		
	val = string.TrimRight( val, "." )