mirror of
https://github.com/djhackersdev/minime.git
synced 2026-08-20 17:34:17 -05:00
Save "last mileage reward" field
Not entirely clear what it does but it prevents a music unlock notification notification from popping at the start of every credit whether or not the underlying music unlock flag is already set.
This commit is contained in:
@@ -61,6 +61,7 @@ export function saveProfile(buf: Buffer): SaveProfileRequest {
|
||||
cup: buf.readUInt8(0x0110),
|
||||
gauges: buf.readUInt16LE(0x0114),
|
||||
music: buf.readUInt16LE(0x0140),
|
||||
lastMileageReward: buf.readUInt32LE(0x013c),
|
||||
},
|
||||
settings: {
|
||||
music: buf.readUInt16LE(0x045a),
|
||||
|
||||
@@ -57,6 +57,7 @@ export function loadProfile2(res: LoadProfileResponse2) {
|
||||
buf.writeUInt16LE(0x0065, 0x0000);
|
||||
buf.writeUInt8(res.unlocks.cup, 0x00b4);
|
||||
buf.writeUInt16LE(res.unlocks.gauges, 0x00b8);
|
||||
buf.writeUInt32LE(res.unlocks.lastMileageReward, 0x01e8);
|
||||
buf.writeUInt16LE(res.unlocks.music, 0x01ec);
|
||||
mission(res.missions.team).copy(buf, 0x038a);
|
||||
buf.writeUInt16LE(0xffff, 0x0388); // [1]
|
||||
|
||||
@@ -30,7 +30,12 @@ export async function createProfile(
|
||||
const missions: MissionState = { team: [], solo: [] };
|
||||
const settings: Settings = { music: 0, pack: 13640, paperCup: 0, gauges: 5 };
|
||||
const story: Story = { x: 0, y: 0, rows: [] };
|
||||
const unlocks: Unlocks = { cup: 0, gauges: 0, music: 0 };
|
||||
const unlocks: Unlocks = {
|
||||
cup: 0,
|
||||
gauges: 1 << 5,
|
||||
music: 0,
|
||||
lastMileageReward: 0,
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
w.profile().save(profile.id, profile),
|
||||
|
||||
@@ -2,4 +2,12 @@ export interface Unlocks {
|
||||
cup: number;
|
||||
gauges: number;
|
||||
music: number;
|
||||
|
||||
// Doesn't really fit anywhere but let's put it here for now. This field is
|
||||
// an odd one, still not entirely sure what its purpose and semantics are,
|
||||
// but if we don't save it then the unlock notification for the music track
|
||||
// THE TOP (unlocked at 300km mileage) pops up at the start of every credit
|
||||
// even if its music unlock bit is set and round-tripped.
|
||||
|
||||
lastMileageReward: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user