Changeset - r15530:e48a7b64c8a5
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-07-21 11:29:59
yexo@openttd.org
(svn r20199) -Fix [FS#3964]: NewGRFs that defined a vehicle without either loaded or loading groups could crash OpenTTD
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_engine.cpp
Show inline comments
 
@@ -841,6 +841,8 @@ static const SpriteGroup *VehicleResolve
 

	
 
	uint totalsets = in_motion ? group->num_loaded : group->num_loading;
 

	
 
	if (totalsets == 0) return NULL;
 

	
 
	uint set = (v->cargo.Count() * totalsets) / max((uint16)1, v->cargo_cap);
 
	set = min(set, totalsets - 1);
 

	
0 comments (0 inline, 0 general)