Skip to content

Commit

Permalink
SteamID: instance bit loss fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rejchev committed Sep 22, 2023
1 parent fbf08bd commit 8ac897e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/github/rejchev/steamid/SteamID.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class SteamID {
* It is usually set to 1 for user accounts.
*
*/
private short instance;
private int instance;

/** NOTE:
*
Expand Down Expand Up @@ -55,7 +55,7 @@ public SteamID(long id) throws SteamViewException {

y = (byte) (id & 0x1);
z = ((int) id) >> 1;
instance = (short) ((id >> 32) & 0xFFFFF);
instance = (int) ((id >> 32) & 0xFFFFF);
type = SteamIDType.values()[(int) ((id >> 52) & 0xF)];
universe = SteamIDUniverse.values()[(int) (id >> 56)];
}
Expand Down Expand Up @@ -91,7 +91,7 @@ public SteamID(String value) {
z = (int) w/2;
y = (byte) (w - z*2);

instance = (params.length > 3) ? Short.parseShort(params[3]) : 1;
instance = (params.length > 3) ? Integer.parseInt(params[3]) : 1;
}
}

Expand All @@ -111,7 +111,7 @@ public void setZ(int z) {
this.z = z;
}

public short getInstance() {
public int getInstance() {
return instance;
}

Expand Down

0 comments on commit 8ac897e

Please sign in to comment.