-
Website
http://buildingbrowsergames.com -
Original page
http://buildingbrowsergames.com/2008/06/17/building-browsergames-healing-your-players-php/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
gabrielbianconi
1 comment · 1 points
-
Luke
82 comments · 1 points
-
spatlabor
1 comment · 1 points
-
HughCompton
2 comments · 1 points
-
obat jerawat
1 comment · 1 points
-
-
Popular Threads
Secondly, on line 28, you poll the database to get the current gold count, yet on line 20 you've already done this and not changed it. Wouldn't it be more efficient to insert a line above 28 such as:
$gold = $gold - $amount;
and then change the setStat to:
setStat( 'gc', $userID, $gold);
You could do the same with the actual healing value as well. Avoid two calls to getStat('curhp',$userID) as you've already got that value.
From a performance point of view wouldn't this be better?
I was building these scripts, I'm afraid they sort of grew organically, so
optimizations that should have been made sometimes didn't.