@@ -348,14 +348,14 @@ internal void setPriority(Priority priority)
348
348
}
349
349
public Procent getMargin ( )
350
350
{
351
- if ( getCountry ( ) . economy . getValue ( ) == Economy . PlannedEconomy )
351
+ if ( getCountry ( ) . economy . getValue ( ) == Economy . PlannedEconomy || ! isWorking ( ) )
352
352
return Procent . ZeroProcent ;
353
353
else
354
354
{
355
355
var divider = Game . market . getCost ( getUpgradeNeeds ( ) ) . get ( ) * level ;
356
356
if ( divider == 0f )
357
- Debug . Log ( "Division by zero in getMargin()" ) ;
358
- return new Procent ( getProfit ( ) / ( divider ) , false ) ;
357
+ Debug . Log ( "Division by zero in getMargin()" ) ;
358
+ return Procent . makeProcent ( getProfit ( ) , divider , false ) ;
359
359
}
360
360
}
361
361
internal Value getReopenCost ( )
@@ -509,9 +509,9 @@ public void ChangeSalary()
509
509
salaryRaise = 0.003f ;
510
510
else if ( margin . get ( ) > 0.1f ) //10%
511
511
salaryRaise = 0.002f ;
512
-
513
-
514
-
512
+
513
+
514
+
515
515
salary . add ( salaryRaise ) ;
516
516
}
517
517
@@ -525,7 +525,7 @@ public void ChangeSalary()
525
525
if ( unemployment . isBiggerThan ( Options . ProvinceExcessWorkforce ) )
526
526
salary . subtract ( 0.001f , false ) ;
527
527
528
- if ( getWorkForce ( ) == 0 ) // && getInputFactor() == 1)
528
+ if ( getWorkForce ( ) == 0 ) // && getInputFactor() == 1)
529
529
salary . set ( getProvince ( ) . getLocalMinSalary ( ) ) ;
530
530
// to help factories catch up other factories salaries
531
531
// salary.set(province.getLocalMinSalary());
@@ -752,7 +752,7 @@ internal void payDividend()
752
752
753
753
754
754
}
755
- }
755
+ }
756
756
757
757
internal void close ( )
758
758
{
@@ -926,9 +926,9 @@ override public void consumeNeeds()
926
926
927
927
if ( getCountry ( ) . economy . getValue ( ) == Economy . PlannedEconomy )
928
928
{
929
- if ( daysInConstruction >= Options . fabricConstructionTimeWithoutCapitalism )
929
+ if ( daysInConstruction >= Options . fabricConstructionTimeWithoutCapitalism )
930
930
if ( getCountry ( ) . countryStorageSet . has ( constructionNeeds ) )
931
- isBuyingComplete = getCountry ( ) . countryStorageSet . send ( this . getInputProductsReserve ( ) , constructionNeeds ) ;
931
+ isBuyingComplete = getCountry ( ) . countryStorageSet . send ( this . getInputProductsReserve ( ) , constructionNeeds ) ;
932
932
}
933
933
else
934
934
{
@@ -973,10 +973,7 @@ override internal float getExpences()
973
973
{
974
974
return base . getExpences ( ) + getSalaryCost ( ) ;
975
975
}
976
- /// <summary>
977
- /// Should optimize? Seek for changes..
978
- /// </summary>
979
- /// <returns></returns>
976
+ //Not necessary ti optimize - cost 0.1% of tick
980
977
public int getWorkForce ( )
981
978
{
982
979
int result = 0 ;
0 commit comments