Worst code you've written
#4

The oldest backup I still same to have is for 0.3b from late 2010. Though this still looks pretty much okay. I've since rewritten some code because of the discovery of functions that I never knew existed, such as clamp(). I had been doing this:
pawn Code:
robmoney = ((PlayerStats[target][pCurCash]/10) > 50000) ? 50000  : robmoney;
which has since been rewritten as
pawn Code:
robmoney = clamp((PlayerStats[target][pCurCash]/10), 0, 50000);
Now also excessively using STREAMER_EXTRA_ID for easy assignment of a value to a pickup. Money, for instance. Saves a load of headaches because I no longer have to use bloated arrays to keep track of which pickupid has which value.
Reply


Messages In This Thread
Worst code you've written - by RajatPawar - 07.04.2014, 08:22
Re: Worst code you've written - by RajatPawar - 08.04.2014, 07:01
Re: Worst code you've written - by GWMPT - 08.04.2014, 09:24
Re: Worst code you've written - by Vince - 08.04.2014, 10:18
Re: Worst code you've written - by Kyle - 08.04.2014, 10:23
Re: Worst code you've written - by RajatPawar - 08.04.2014, 12:59
Re: Worst code you've written - by AssMunchingFool - 09.04.2014, 06:13
Re: Worst code you've written - by admiralspeedy - 12.04.2014, 04:09
Re: Worst code you've written - by Sasino97 - 12.04.2014, 21:12
Re: Worst code you've written - by theYiin - 03.07.2014, 12:17

Forum Jump:


Users browsing this thread: 1 Guest(s)