Changeset - r5607:024dca12843c
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2007-01-11 14:40:12
peter1138@openttd.org
(svn r8063) -Codechange: When evaluating newgrf varaction2s the 'last value' should start off at 0, and the result of the operation is remembered.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -131,7 +131,7 @@ static U EvalAdjustT(const Deterministic
 
static inline const SpriteGroup *ResolveVariable(const SpriteGroup *group, ResolverObject *object)
 
{
 
	static SpriteGroup nvarzero;
 
	uint32 last_value = object->last_value;
 
	uint32 last_value = 0;
 
	uint32 value = 0;
 
	uint i;
 

	
 
@@ -159,6 +159,8 @@ static inline const SpriteGroup *Resolve
 
		last_value = value;
 
	}
 

	
 
	object->last_value = last_value;
 

	
 
	if (group->g.determ.num_ranges == 0) {
 
		/* nvar == 0 is a special case -- we turn our value into a callback result */
 
		nvarzero.type = SGT_CALLBACK;
0 comments (0 inline, 0 general)