~ubuntu-branches/ubuntu/maverick/asc/maverick

« back to all changes in this revision

Viewing changes to source/buildings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar (Debian packages)
  • Date: 2006-06-15 17:43:41 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060615174341-b21yhmph04eiauk9
Tags: 1.16.3.0-3
* Adopted package and moved it to the Debian Games Team repository.
* Set Bartosz Fenski, Alexander Schmehl and myself as uploaders.

* debian/control:
  + Set policy to 3.7.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
339
339
 
340
340
void    Building :: produceAmmo ( int type, int num )
341
341
{
342
 
   num = ((num + weaponpackagesize - 1) / weaponpackagesize)*weaponpackagesize;
343
342
   Resources res;
344
343
   for( int j = 0; j< resourceTypeNum; j++ )
345
 
      res.resource(j) = cwaffenproduktionskosten[type][j] * num / 5;
 
344
      res.resource(j) = cwaffenproduktionskosten[type][j] * num;
346
345
 
347
346
   ContainerBase* cb = this;  // Really strange. Building is derived from Containerbase, but getResource doesn't work here
348
347
   Resources res2 = cb->getResource ( res, 1 );
351
350
       if ( res.resource(i) )
352
351
          perc = min ( perc, 100 * res2.resource(i) / res.resource(i) );
353
352
   int produceable = num * perc / 100 ;
354
 
   int produceablePackages = produceable / 5;
 
353
   int produceablePackages = produceable;
355
354
 
356
355
   for( int k = 0; k< resourceTypeNum; k++ )
357
356
      res.resource(k) = cwaffenproduktionskosten[type][k] * produceablePackages;
358
357
 
359
358
   cb->getResource ( res, 0 );
360
359
 
361
 
   ammo[type] += produceablePackages * 5;
 
360
   ammo[type] += produceablePackages;
362
361
}
363
362
 
364
363