Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.43k stars 382 forks source link

Error when using /firework command without specifying a color #2507

Closed Kojirremer closed 2 years ago

Kojirremer commented 2 years ago

Reproduction steps:

1a. Use the /firework command on either yourself or someone else without any parameter: /firework <PlayerName> 2a. You will get an error message and the firework won't spawn.

1b. Use the /firework command like on 1a, but adding the color parameter at the end: /firework <PlayerName> red 2b. The firework will spawn without issue.

2021-11-22 11:53:48 - TShockCommandExtensions: ERROR: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00011] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0 
  at TShockAPI.Commands.FireWork (TShockAPI.CommandArgs args) [0x0020f] in <22d3313c96b04df98669b2de578a0292>:0 
  at Wolfje.Plugins.Jist.Extensions.TShockCommandExtensions.RunWithoutPermissions (TShockAPI.Command cmd, System.String msg, TShockAPI.TSPlayer ply, System.Collections.Generic.List`1[T] parms, System.Boolean silent) [0x00010] in <18a265367b634964941709e01a3905cf>:0 
2021-11-22 11:53:48 - Utils: INFO: Nobu executed: /firework "Nobu".
2021-11-22 11:53:48 - TShockCommandExtensions: ERROR: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00011] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0 
  at TShockAPI.Commands.FireWork (TShockAPI.CommandArgs args) [0x0020f] in <22d3313c96b04df98669b2de578a0292>:0 
  at Wolfje.Plugins.Jist.Extensions.TShockCommandExtensions.RunWithoutPermissions (TShockAPI.Command cmd, System.String msg, TShockAPI.TSPlayer ply, System.Collections.Generic.List`1[T] parms, System.Boolean silent) [0x00010] in <18a265367b634964941709e01a3905cf>:0 

JIST appears in the error because I've got a script that fireworks everyone each hour, but as shown below, just using the command brings the same result.

20211123004432_1

20211123004443_1

20211123004459_1

20211123004503_1

Plugins running:

moisterrific commented 2 years ago

That's weird, it's supposed to default to red fireworks if you don't specify any colour.

Kojirremer commented 2 years ago

That's weird, it's supposed to default to red fireworks if you don't specify any colour.

That used to be the case until the 1.4.3.0 update. I don't know what changed there, but I'm pretty sure it defaulted to red before the update dropped.

moisterrific commented 2 years ago

That's weird, it's supposed to default to red fireworks if you don't specify any colour.

That used to be the case until the 1.4.3.0 update. I don't know what changed there, but I'm pretty sure it defaulted to red before the update dropped.

I'm not sure if it's caused by the game update or some TShock change, either way it's likely firework isn't the only thing that broke.