CTR: Enable Achievement Support

This commit is contained in:
Steam Deck User 2022-12-28 13:10:44 -05:00
parent d3e4af8707
commit cdda3a943d
2 changed files with 13 additions and 18 deletions

View file

@ -425,19 +425,18 @@ void(string chaptertitle, string location, string date, string person, entity wh
#endif
#ifndef NX
#ifndef CTR
void (float achievement_id, optional entity who) GiveAchievement =
{
#ifdef PSP
#ifndef PC
// temp
if (achievement_id > 4)
return;
#endif // PSP
#endif // PC
// this is an achievement specific to an individual
if ((who && who != world) || player_count == 0) {
if (player_count == 0) who = find(world, classname, "player");
#ifdef PSP
#ifndef PC
achievement(who, achievement_id);
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
@ -445,9 +444,9 @@ void (float achievement_id, optional entity who) GiveAchievement =
WriteByte(MSG_MULTICAST, achievement_id);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
#endif // PSP
#endif // PC
} else {
#ifdef PSP
#ifndef PC
entity players;
players = find(world, classname, "player");
while(players != world) {
@ -459,21 +458,21 @@ void (float achievement_id, optional entity who) GiveAchievement =
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENT);
WriteByte(MSG_MULTICAST, achievement_id);
multicast('0 0 0', MULTICAST_ALL);
#endif // PSP
#endif // PC
}
}
void (float achievement_id, float progress_value, optional entity who) UpdateAchievementProgress =
{
#ifdef PSP
#ifndef PC
// temp
if (achievement_id > 4)
return;
#endif // PSP
#endif // PC
// this is a progress update specific to an individual
if ((who && who != world) || player_count == 0) {
if (player_count == 0) who = find(world, classname, "player");
#ifdef PSP
#ifndef PC
//achievement_progress(who, achievement_id, progress_value);
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
@ -482,9 +481,9 @@ void (float achievement_id, float progress_value, optional entity who) UpdateAch
WriteFloat(MSG_MULTICAST, progress_value);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
#endif // PSP
#endif // PC
} else {
#ifdef PSP
#ifndef PC
entity players;
players = find(world, classname, "player");
while(players != world) {
@ -497,10 +496,9 @@ void (float achievement_id, float progress_value, optional entity who) UpdateAch
WriteByte(MSG_MULTICAST, achievement_id);
WriteFloat(MSG_MULTICAST, progress_value);
multicast('0 0 0', MULTICAST_ALL);
#endif // PSP
#endif // PC
}
}
#endif // CTR
#endif // NX
// *****************************************

View file

@ -32,7 +32,4 @@ void LoadWaypointData() = {};
.float MaxRange;
float gotdog;
void(string chaptertitle, string location, string date, string person, entity who) WorldText = {};
void GiveAchievement(float achievement_id, optional entity who) = {};
void(string chaptertitle, string location, string date, string person, entity who) WorldText = {};