@@ -2990,7 +2990,8 @@ func (be BytecodeExp) run_ex(c *Char, i *int, oc *Char) {
29902990 case OC_ex_ishost :
29912991 sys .bcStack .PushB (c .isHost ())
29922992 case OC_ex_jugglepoints :
2993- * sys .bcStack .Top () = c .jugglePoints (* sys .bcStack .Top ())
2993+ v1 := sys .bcStack .Pop ()
2994+ sys .bcStack .PushI (c .jugglePoints (v1 .ToI ()))
29942995 case OC_ex_localcoord_x :
29952996 sys .bcStack .PushF (sys .cgi [c .playerNo ].localcoord [0 ])
29962997 case OC_ex_localcoord_y :
@@ -5519,10 +5520,10 @@ const (
55195520 explod_interpolate_pfx_color
55205521 explod_interpolate_pfx_hue
55215522 explod_interpolation
5522- explod_redirectid
55235523 explod_animplayerno
55245524 explod_spriteplayerno
55255525 explod_last = iota + palFX_last + 1 - 1
5526+ explod_redirectid
55265527)
55275528
55285529func (sc explod ) Run (c * Char , _ []int32 ) bool {
@@ -5902,13 +5903,6 @@ func (sc modifyExplod) Run(c *Char, _ []int32) bool {
59025903
59035904 StateControllerBase (sc ).run (c , func (paramID byte , exp []BytecodeExp ) bool {
59045905 switch paramID {
5905- case explod_redirectid :
5906- if rid := sys .playerID (exp [0 ].evalI (c )); rid != nil {
5907- crun = rid
5908- redirscale = c .localscl / crun .localscl
5909- } else {
5910- return false
5911- }
59125906 case explod_animplayerno :
59135907 pn := int (exp [0 ].evalI (c )) - 1
59145908 if crun .validatePlayerNo (pn , "animPlayerNo" , "modifyExplod" ) {
@@ -11602,12 +11596,11 @@ func (sc modifySnd) Run(c *Char, _ []int32) bool {
1160211596
1160311597 x := & crun .pos [0 ]
1160411598 ls := crun .localscl
11599+ var snd * SoundChannel
1160511600 var ch , pri int32 = - 1 , 0
11601+ var stopgh , stopcs int32 = - 1 , - 1 // Undefined bools
1160611602 var vo , fr float32 = 100 , 1.0
11607- snd := crun .soundChannels .Get (- 1 )
11608- stopgh , stopcs := false , false
1160911603 freqMulSet , volumeSet , prioritySet , panSet , loopStartSet , loopEndSet , posSet , lcSet , loopSet := false , false , false , false , false , false , false , false , false
11610- stopghSet , stopcsSet := false , false
1161111604 var loopstart , loopend , position , lc int = 0 , 0 , 0 , 0
1161211605 var p float32 = 0
1161311606
@@ -11662,12 +11655,13 @@ func (sc modifySnd) Run(c *Char, _ []int32) bool {
1166211655 }
1166311656 lcSet = true
1166411657 case modifySnd_stopongethit :
11665- stopgh = exp [0 ].evalB (c )
11658+ stopgh = Btoi ( exp [0 ].evalB (c ) )
1166611659 case modifySnd_stoponchangestate :
11667- stopcs = exp [0 ].evalB (c )
11660+ stopcs = Btoi ( exp [0 ].evalB (c ) )
1166811661 }
1166911662 return true
1167011663 })
11664+
1167111665 // Grab the correct sound channel now
1167211666 channelCount := 1
1167311667 if ch < 0 {
@@ -11724,11 +11718,11 @@ func (sc modifySnd) Run(c *Char, _ []int32) bool {
1172411718 snd .SetVolume (vo )
1172511719 }
1172611720 // These flags can be updated regardless since there are no calculations involved
11727- if stopghSet {
11728- snd .stopOnGetHit = stopgh
11721+ if stopgh >= 0 {
11722+ snd .stopOnGetHit = stopgh != 0
1172911723 }
11730- if stopcsSet {
11731- snd .stopOnChangeState = stopcs
11724+ if stopcs >= 0 {
11725+ snd .stopOnChangeState = stopgh != 0
1173211726 }
1173311727 }
1173411728 }
@@ -11986,8 +11980,8 @@ const (
1198611980 text_color
1198711981 text_xshear
1198811982 text_id
11989- text_redirectid
1199011983 text_last = iota + palFX_last + 1 - 1
11984+ text_redirectid
1199111985)
1199211986
1199311987func (sc text ) Run (c * Char , _ []int32 ) bool {
@@ -12041,7 +12035,14 @@ func (sc text) Run(c *Char, _ []int32) bool {
1204112035 fnt = - 1
1204212036 }
1204312037 case text_localcoord :
12044- ts .SetLocalcoord (exp [0 ].evalF (c ), exp [1 ].evalF (c ))
12038+ var x , y float32
12039+ x = exp [0 ].evalF (c )
12040+ if len (exp ) > 1 {
12041+ y = exp [1 ].evalF (c )
12042+ }
12043+ if x > 0 && y > 0 { // TODO: Maybe this safeguard could be in SetLocalcoord instead
12044+ ts .SetLocalcoord (x , y )
12045+ }
1204512046 case text_bank :
1204612047 ts .bank = exp [0 ].evalI (c )
1204712048 case text_align :
@@ -12981,30 +12982,7 @@ func (sc targetAdd) Run(c *Char, _ []int32) bool {
1298112982 return true
1298212983 })
1298312984
12984- // Check if ID exists
12985- if pid > 0 {
12986- for i := range sys .chars {
12987- for j := range sys .chars [i ] {
12988- if sys.chars [i ][j ].id == pid {
12989- // Add target to char's "target" list
12990- // This function already prevents duplicating targets
12991- crun .addTarget (pid )
12992- // Add char to target's "targeted by" list
12993- // Keep juggle points if target already exists
12994- jug := crun .gi ().data .airjuggle
12995- for _ , v := range sys.chars [i ][j ].ghv .targetedBy {
12996- if v [0 ] == crun .id {
12997- jug = v [1 ]
12998- }
12999- }
13000- // Remove then readd char to the list with the new juggle points
13001- sys.chars [i ][j ].ghv .dropId (crun .id )
13002- sys.chars [i ][j ].ghv .targetedBy = append (sys.chars [i ][j ].ghv .targetedBy , [... ]int32 {crun .id , jug })
13003- break
13004- }
13005- }
13006- }
13007- }
12985+ crun .targetAddSctrl (pid )
1300812986
1300912987 return false
1301012988}
0 commit comments