You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 23:16:20 +00:00
🆙 Lets make the beds even greater
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import { IMessageDataWrapper, IMessageParser, ObjectRolling } from '@nitrots/api';
|
||||
import { Vector3d } from '@nitrots/utils';
|
||||
|
||||
function parseLocaleFloat(value: string): number
|
||||
{
|
||||
if(!value) return 0;
|
||||
|
||||
return parseFloat(value.replace(',', '.'));
|
||||
}
|
||||
|
||||
export class ObjectsRollingParser implements IMessageParser
|
||||
{
|
||||
private _rollerId: number;
|
||||
@@ -31,8 +38,8 @@ export class ObjectsRollingParser implements IMessageParser
|
||||
while(totalItems > 0)
|
||||
{
|
||||
const id = wrapper.readInt();
|
||||
const height = parseFloat(wrapper.readString());
|
||||
const nextHeight = parseFloat(wrapper.readString());
|
||||
const height = parseLocaleFloat(wrapper.readString());
|
||||
const nextHeight = parseLocaleFloat(wrapper.readString());
|
||||
const rollingData = new ObjectRolling(id, new Vector3d(x, y, height), new Vector3d(nextX, nextY, nextHeight));
|
||||
|
||||
this._itemsRolling.push(rollingData);
|
||||
@@ -46,8 +53,8 @@ export class ObjectsRollingParser implements IMessageParser
|
||||
|
||||
const movementType = wrapper.readInt();
|
||||
const unitId = wrapper.readInt();
|
||||
const height = parseFloat(wrapper.readString());
|
||||
const nextHeight = parseFloat(wrapper.readString());
|
||||
const height = parseLocaleFloat(wrapper.readString());
|
||||
const nextHeight = parseLocaleFloat(wrapper.readString());
|
||||
|
||||
switch(movementType)
|
||||
{
|
||||
|
||||
+9
-2
@@ -1,6 +1,13 @@
|
||||
import { IMessageDataWrapper, IObjectData } from '@nitrots/api';
|
||||
import { FurnitureDataParser } from '../FurnitureDataParser';
|
||||
|
||||
function parseLocaleFloat(value: string): number
|
||||
{
|
||||
if(!value) return 0;
|
||||
|
||||
return parseFloat(value.replace(',', '.'));
|
||||
}
|
||||
|
||||
export class FurnitureFloorDataParser
|
||||
{
|
||||
private _itemId: number;
|
||||
@@ -57,8 +64,8 @@ export class FurnitureFloorDataParser
|
||||
this._x = wrapper.readInt();
|
||||
this._y = wrapper.readInt();
|
||||
this._direction = ((wrapper.readInt() % 8) * 45);
|
||||
this._z = parseFloat(wrapper.readString());
|
||||
this._stackHeight = parseFloat(wrapper.readString());
|
||||
this._z = parseLocaleFloat(wrapper.readString());
|
||||
this._stackHeight = parseLocaleFloat(wrapper.readString());
|
||||
this._extra = wrapper.readInt();
|
||||
this._data = FurnitureDataParser.parseObjectData(wrapper);
|
||||
this._state = parseFloat(this._data && this._data.getLegacyString()) || 0;
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { IMessageDataWrapper, IMessageParser, RoomObjectType } from '@nitrots/api';
|
||||
import { UserMessageData } from './UserMessageData';
|
||||
|
||||
function parseLocaleFloat(value: string): number
|
||||
{
|
||||
if(!value) return 0;
|
||||
|
||||
return parseFloat(value.replace(',', '.'));
|
||||
}
|
||||
|
||||
export class RoomUnitParser implements IMessageParser
|
||||
{
|
||||
private _users: UserMessageData[];
|
||||
@@ -34,7 +41,7 @@ export class RoomUnitParser implements IMessageParser
|
||||
const roomIndex = wrapper.readInt();
|
||||
const x = wrapper.readInt();
|
||||
const y = wrapper.readInt();
|
||||
const z = parseFloat(wrapper.readString());
|
||||
const z = parseLocaleFloat(wrapper.readString());
|
||||
const direction = wrapper.readInt();
|
||||
const type = wrapper.readInt();
|
||||
|
||||
|
||||
@@ -2,6 +2,13 @@ import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { RoomUnitStatusAction } from './RoomUnitStatusAction';
|
||||
import { RoomUnitStatusMessage } from './RoomUnitStatusMessage';
|
||||
|
||||
function parseLocaleFloat(value: string): number
|
||||
{
|
||||
if(!value) return 0;
|
||||
|
||||
return parseFloat(value.replace(',', '.'));
|
||||
}
|
||||
|
||||
export class RoomUnitStatusParser implements IMessageParser
|
||||
{
|
||||
private _statuses: RoomUnitStatusMessage[];
|
||||
@@ -45,7 +52,7 @@ export class RoomUnitStatusParser implements IMessageParser
|
||||
const unitId = wrapper.readInt();
|
||||
const x = wrapper.readInt();
|
||||
const y = wrapper.readInt();
|
||||
const z = parseFloat(wrapper.readString());
|
||||
const z = parseLocaleFloat(wrapper.readString());
|
||||
const headDirection = ((wrapper.readInt() % 8) * 45);
|
||||
const direction = ((wrapper.readInt() % 8) * 45);
|
||||
const actions = wrapper.readString();
|
||||
@@ -80,14 +87,14 @@ export class RoomUnitStatusParser implements IMessageParser
|
||||
{
|
||||
targetX = parseInt(values[0]);
|
||||
targetY = parseInt(values[1]);
|
||||
targetZ = parseFloat(values[2]);
|
||||
targetZ = parseLocaleFloat(values[2]);
|
||||
didMove = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 'sit': {
|
||||
const sitHeight = parseFloat(parts[1]);
|
||||
const sitHeight = parseLocaleFloat(parts[1]);
|
||||
|
||||
if(parts.length >= 3) canStandUp = (parts[2] === '1');
|
||||
|
||||
@@ -96,9 +103,7 @@ export class RoomUnitStatusParser implements IMessageParser
|
||||
break;
|
||||
}
|
||||
case 'lay': {
|
||||
const layHeight = parseFloat(parts[1]);
|
||||
|
||||
height = Math.abs(layHeight);
|
||||
height = parseLocaleFloat(parts[1]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user