mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Revert changes
This commit is contained in:
1 parent
7871eae7a3
commit
d2fa93ee71
1 file changed
+5
-11
+5
-11
@@ -176,17 +176,11 @@ export function Modules() {
|
|||||||
(turret) => turret.id === unlock.id
|
(turret) => turret.id === unlock.id
|
||||||
)!;
|
)!;
|
||||||
|
|
||||||
// Check if current gun exists in new turret
|
if (
|
||||||
const gunInNewTurret = draft.protagonist.turret.guns.find(
|
!draft.protagonist.turret.guns.some(
|
||||||
(gun) => gun.id === draft.protagonist.gun.id
|
(gun) => gun.id === draft.protagonist.gun.id
|
||||||
);
|
)
|
||||||
|
) {
|
||||||
if (gunInNewTurret) {
|
|
||||||
// Gun exists - get it FROM this turret (this fixes the bug!)
|
|
||||||
draft.protagonist.gun = gunInNewTurret;
|
|
||||||
draft.protagonist.shell = gunInNewTurret.shells[0];
|
|
||||||
} else {
|
|
||||||
// Gun doesn't exist - select top gun from new turret
|
|
||||||
draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!;
|
draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!;
|
||||||
draft.protagonist.shell = draft.protagonist.gun.shells[0];
|
draft.protagonist.shell = draft.protagonist.gun.shells[0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user