Advertisement
Guest User

function for generating of park of vehicle

a guest
May 13th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1.  
  2. org_num_1 = 2;
  3. org_num = 136; // gen_start with Cult of Sirius(136/34=4)
  4. v17 = 2;
  5. org_ = (funds *)((char *)save_funding + 876); // 468*2
  6. do
  7. {
  8. org_num_2 = 0;
  9. hostile_org_count = 0;
  10. do
  11. {
  12. if ( org_num_2 != org_num_1 && org_num_2 != 1 )
  13. {
  14. v3 = 0; // no_hostlile
  15. if ( *(&relation_formerly[(signed __int16)org_num_1].field_3 + org_num_2) <= relation_hostile_lim )// relation_hostile_lim == db 0CEh
  16. v3 = 1; // hostile
  17. if ( v3 )
  18. hostile_org_count += 2;
  19. }
  20. ++org_num_2;
  21. }
  22. while ( org_num_2 < 27 );
  23. buy_veh_fund = (org_veh_fund_init[v17] + hostile_org_count) * org_->start_funds / 100;
  24. org_->start_funds -= buy_veh_fund;
  25. polis_offset = 80 * (org_num_1 == 3); // for Megapol: 20*4 offset in array
  26. veh_count = 0;
  27. do
  28. {
  29. veh = *(int *)((char *)&gen_org_veh_list[(unsigned __int16)make_random(19)] + polis_offset);// note: &gen_org_veh_list[make_random(19) + polic_offset]
  30. v8 = org_num + 2 * veh;
  31. if ( *(unsigned __int16 *)((char *)veh_park + v8) < veh_lim[veh] )
  32. {
  33. price = veh_economic[veh].current_price;
  34. if ( buy_veh_fund >= price )
  35. {
  36. buy_veh_fund -= price;
  37. ++*(__int16 *)((char *)veh_park + v8);
  38. }
  39. }
  40. ++veh_count;
  41. }
  42. while ( veh_count < 50 );
  43. org_num_1 = v7 + 1;
  44. ++v17;
  45. org_->start_funds += buy_veh_fund;
  46. result = org_num + 68;
  47. org_ = (funds *)((char *)org_ + 438);
  48. org_num += 68;
  49. }
  50. while ( org_num_1 < 27 );
  51. org__ = 0;
  52. v12 = (init_funds_struct *)save_funding;
  53. v19 = 0;
  54. do
  55. {
  56. HIWORD(v12[1].funds) = 0;
  57. if ( org__ != 1 )
  58. {
  59. v13 = &veh_struct;
  60. veh_num = 0;
  61. do
  62. {
  63. if ( *v13 >> 16 != -1 && *(int *)((char *)v13 + 298) >> 16 == org__ )
  64. HIWORD(v12[1].funds) += word_12862A[63 * (*(int *)((char *)v13 + 2) >> 16)];
  65. ++veh_num;
  66. v13 = (int *)((char *)v13 + 630);
  67. }
  68. while ( (signed __int16)veh_num < 80 );
  69. result = 0;
  70. do
  71. {
  72. v15 = 2 * (signed __int16)result;
  73. v16 = 63 * (signed __int16)result++;
  74. HIWORD(v12[1].funds) += *(__int16 *)((char *)&veh_park[v19] + v15) * word_12862A[v16];
  75. }
  76. while ( (signed __int16)result < 34 );
  77. }
  78. ++org__;
  79. v12 = (init_funds_struct *)((char *)v12 + 438);
  80. v19 += 34;
  81. }
  82. while ( org__ < 27 );
  83. return result;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement