Try to fill the chamber.
922 {
923 bool didSomething = false;
924 bool chamberFullRng = (flags & WeaponWithAmmoFlags.CHAMBER_RNG_SPORADIC);
925 bool chamberRng = (flags & WeaponWithAmmoFlags.CHAMBER_RNG);
926 bool chamber = (flags & WeaponWithAmmoFlags.CHAMBER);
927
928
929 if (chamber || chamberFullRng)
930 {
931
933 {
935 return false;
936 }
937 else if (!(flags & WeaponWithAmmoFlags.AMMO_CHAMBER_RNG))
938 {
939 ammoType = GetRandomChamberableAmmoTypeName(0);
940 }
941
942
943 int muzzCount = GetMuzzleCount();
944 int amountToChamber = muzzCount;
945
946 if (chamberRng)
947 amountToChamber = Math.RandomIntInclusive(0, muzzCount);
948
949
950 for (int m = 0; m < muzzCount; ++m)
951 {
952 if (chamberFullRng)
953 chamber = Math.RandomIntInclusive(0, 1);
954
955 if (chamber)
956 {
958 {
959 didSomething = true;
960 amountToChamber--;
961 if (amountToChamber <= 0)
962 break;
963 }
964 }
965 }
966 }
967
968 if (!didSomething)
969 return false;
970
971
974
975 return true;
976 }
bool FillSpecificChamber(int muzzleIndex, float dmg=0, string ammoType="")
void RandomizeFSMState()
With the parameters given, selects a random suitable state for the FSM of the weapon @WARNING: Weapon...