Skip to content

Commit cd558b9

Browse files
authored
Merge pull request #3738 from potsmugen/push2
fix: friendly PlayerPush, ontop explods, Camera sctrl pos
2 parents 044da72 + c1d51b7 commit cd558b9

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

src/bytecode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14245,9 +14245,9 @@ func (sc cameraCtrl) Run(c *Char, _ []int32) bool {
1424514245
sys.cam.FollowChar = c
1424614246
}
1424714247
case cameraCtrl_pos:
14248-
sys.cam.Pos[0] = exp[0].evalF(c)
14248+
sys.cam.Pos[0] = exp[0].evalF(c) * c.localscl
1424914249
if len(exp) > 1 {
14250-
sys.cam.Pos[1] = exp[1].evalF(c)
14250+
sys.cam.Pos[1] = exp[1].evalF(c) * c.localscl
1425114251
}
1425214252
case cameraCtrl_followid:
1425314253
if cid := sys.playerID(exp[0].evalI(c)); cid != nil {

src/char.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13568,20 +13568,24 @@ func (cl *CharList) pushDetection(getter *Char) {
1356813568
}
1356913569

1357013570
for _, c := range cl.runOrder {
13571-
// Stop current iteration if char won't push
13572-
interact := false
13571+
// Stop current iteration if char won't ever push
13572+
if !c.csf(CSF_playerpush) || c.scf(SCF_standby) || c.scf(SCF_disabled) {
13573+
continue
13574+
}
13575+
13576+
// AffectTeam check
13577+
// The logic here needs to be a bit uneven because the default state (pushing enemies only) also is
1357313578
if c.teamside == getter.teamside {
13574-
if c.pushAffectTeam <= 0 {
13575-
interact = true
13579+
// Partners are permissive: skip only if both are in "enemy" mode
13580+
if c.pushAffectTeam > 0 && getter.pushAffectTeam > 0 {
13581+
continue
1357613582
}
1357713583
} else {
13578-
if c.pushAffectTeam >= 0 && getter.pushAffectTeam >= 0 {
13579-
interact = true
13584+
// Enemies are strict: skip if either one is in "friendly" mode
13585+
if c.pushAffectTeam < 0 || getter.pushAffectTeam < 0 {
13586+
continue
1358013587
}
1358113588
}
13582-
if !c.csf(CSF_playerpush) || !interact || c.scf(SCF_standby) || c.scf(SCF_disabled) {
13583-
continue
13584-
}
1358513589

1358613590
// Get size box
1358713591
// We wil check overlap for the first boxes only

src/system.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,10 +2878,11 @@ func (s *System) explodCueDraw() {
28782878
if a.ontop != b.ontop {
28792879
return a.ontop
28802880
}
2881-
// If both are ontop the normal logic is inverted (old index shift trick)
2881+
// If both are ontop, the age logic is the same as normal, but the index tiebreaker is inverted
2882+
// https://github.com/ikemen-engine/Ikemen-GO/issues/3737
28822883
if a.ontop && b.ontop {
28832884
if a.timestamp != b.timestamp {
2884-
return a.timestamp >= b.timestamp
2885+
return a.timestamp < b.timestamp
28852886
}
28862887
return a.sortindex >= b.sortindex
28872888
}

0 commit comments

Comments
 (0)