mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
Fix object id decoded as wrong signedness. (#670)
* Fix id being decoded as an signed integer instead of an unsigned integer. (#660) --------- Co-authored-by: karstensensensen <simonblsoerensen@gmail.com>
This commit is contained in:
@@ -377,10 +377,16 @@ export class ServerController {
|
||||
break;
|
||||
}
|
||||
case "message:inspect_object": {
|
||||
const id = BigInt(command.parameters[0]);
|
||||
let id = BigInt(command.parameters[0]);
|
||||
const className: string = command.parameters[1];
|
||||
const properties: any[] = command.parameters[2];
|
||||
|
||||
// message:inspect_object returns the id as an unsigned 64 bit integer, but it is decoded as a signed 64 bit integer,
|
||||
// thus we need to convert it to its equivalent unsigned value here.
|
||||
if (id < 0) {
|
||||
id = id + BigInt(2) ** BigInt(64);
|
||||
}
|
||||
|
||||
const rawObject = new RawObject(className);
|
||||
properties.forEach((prop) => {
|
||||
rawObject.set(prop[0], prop[5]);
|
||||
|
||||
@@ -376,10 +376,16 @@ export class ServerController {
|
||||
break;
|
||||
}
|
||||
case "scene:inspect_object": {
|
||||
const id = BigInt(command.parameters[0]);
|
||||
let id = BigInt(command.parameters[0]);
|
||||
const className: string = command.parameters[1];
|
||||
const properties: any[] = command.parameters[2];
|
||||
|
||||
// message:inspect_object returns the id as an unsigned 64 bit integer, but it is decoded as a signed 64 bit integer,
|
||||
// thus we need to convert it to its equivalent unsigned value here.
|
||||
if (id < 0) {
|
||||
id = id + BigInt(2) ** BigInt(64);
|
||||
}
|
||||
|
||||
const rawObject = new RawObject(className);
|
||||
properties.forEach((prop) => {
|
||||
rawObject.set(prop[0], prop[5]);
|
||||
|
||||
Reference in New Issue
Block a user