Skip to content

Commit

Permalink
bugfix: network desync with 10x/100x mulitplier
Browse files Browse the repository at this point in the history
  • Loading branch information
Manticore-007 committed Nov 14, 2023
1 parent 49ebd46 commit e433978
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface StaffEnergy {

export interface StaffCoordinates extends StaffEnergy{
axis: keyof CoordsXYZ;
multiplier: number;
}

export interface SetStaffEnergy {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "openrct2-peep-editor",
"author": "Manticore-007",
"license": "MIT",
"version": "23.7.23",
"description": "",
"version": "23.11.14",
"description": "",
"main": "app.js",
"scripts": {
"start": "npm run watch",
Expand Down
9 changes: 5 additions & 4 deletions src/gameActions/staffChangeCoordinates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ export function changeStaffCoordinatesExecute(args: StaffCoordinates): GameActio
const staff: Staff = <Staff>entity;
const axis: keyof CoordsXYZ = args.axis;
const operator: number = args.operator;
const _multiplier: number = args.multiplier;

return changeSpinner(staff, axis, operator);
return changeSpinner(staff, axis, operator, _multiplier);
}

function changeSpinner(staff: Staff, axis: keyof CoordsXYZ, operator: number): GameActionResult
function changeSpinner(staff: Staff, axis: keyof CoordsXYZ, operator: number, _multiplier: number): GameActionResult
{
staff[axis] += operator * multiplier;
staff[axis] += operator * _multiplier;
return {};
}

export function changeStaffCoordinatesExecuteArgs(staff: Staff, axis: keyof CoordsXYZ, operator: number): StaffCoordinates
{
return { "staffId": staff.id, "axis": axis, "operator": operator };
return { "staffId": staff.id, "axis": axis, "operator": operator, "multiplier": multiplier };
}


Expand Down

0 comments on commit e433978

Please sign in to comment.