Skip to content

[BUG]: SSDropdown has one line off #253

@Someone-193

Description

@Someone-193

Before You Report

  • I have searched for existing reports of this bug, and this bug report is unique.

Version

1.1.1 (but it's base game stuff)

Description

SSDropdownSetting's SendDropdownUpdate uses this.Options instead of newOptions when called (other settings dont do this, they use the new value)

An example of an actual bug would be trying to send fake dropdown options to clients, with this method, you just cant do that without forcing the dropdowns Options (hell it even makes the applyOverride bool in the method useless)

To Reproduce

Try sending fake dropdown options without having to forcibly overwrite the settings Options property.

Expected Behavior

public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
this.Options.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}

------>

public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
newOptions.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}

so I can fake the options of a setting without overriding the property of the setting

Additional Information

why is this required

Metadata

Metadata

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions