Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Client-side faction sync #2052

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

ZikkeyLS
Copy link
Contributor

No description provided.

@@ -285,6 +285,11 @@ export class FormView implements View<FormModel> {
if (model.appearance && model.appearance.name) {
refr?.setDisplayName("" + model.appearance.name, true);
}
if (model.factions !== undefined && model.factions.length > 0) {
for (let i = 0; i < model.factions.length; i++) {
(Actor.from(refr) as any).addToFaction(Faction.from(Game.getFormEx(model.factions[i].formDesc)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actor.from is expensive. should be put out of loop. also it can return null which should be checked

@@ -0,0 +1,5 @@

export interface Faction {
formDesc: number;
Copy link
Contributor

@Pospelove Pospelove Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formDesc => formId (var name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants