Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/VortexQuake2/Vortex
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex-Quake2 committed Sep 21, 2024
2 parents 0623731 + 4f11cc5 commit 1b88135
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/characters/prestige.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,15 @@ void vrx_prestige_menu_handler(edict_t *self, int option) {
break;
case PRESTIGE_ABILITY_POINTS:
self->myskills.speciality_points += 1;
self->myskills.prestige.abilityPoints += 1;
self->myskills.prestige.points -= 1;
gi.cprintf(self, PRINT_HIGH, "You have gained an additional ability point.\n");
break;
case PRESTIGE_WEAPON_POINTS:
self->myskills.weapon_points += 1;
self->myskills.weapon_points += 4;
self->myskills.prestige.weaponPoints += 1;
self->myskills.prestige.points -= 1;
gi.cprintf(self, PRINT_HIGH, "You have gained additional weapon points.\n");
break;
case PRESTIGE_ASCEND:
vrx_prestige_ascend(self);
Expand Down Expand Up @@ -250,7 +254,7 @@ void vrx_prestige_reapply_abilities(edict_t* self) {
void vrx_prestige_reapply_all(edict_t *self) {
struct prestigelist_s *pre = &self->myskills.prestige;
self->myskills.speciality_points += pre->abilityPoints;
self->myskills.weapon_points += pre->weaponPoints;
self->myskills.weapon_points += pre->weaponPoints * 4;

vrx_prestige_reapply_abilities(self);
}
Expand Down
13 changes: 8 additions & 5 deletions src/characters/v_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,14 +1467,17 @@ void vrx_change_class(char *playername, int newclass, int msgtype) {

player->myskills.level = 0;
player->myskills.next_level = vrx_get_points_tnl(0);
player->myskills.experience = 0;

for (int j = 1; j <= start_level->value; ++j) {
player->myskills.experience += vrx_get_points_tnl(j - 1);
// reset experience to zero but only if they are ascending
if (msgtype == CHANGECLASS_MSG_ASCEND) {
player->myskills.experience = 0;
for (int j = 1; j <= start_level->value; ++j) {
player->myskills.experience += vrx_get_points_tnl(j - 1);
}
}

player->myskills.speciality_points = 0;
player->myskills.weapon_points = 0;
player->myskills.speciality_points = player->myskills.prestige.abilityPoints;
player->myskills.weapon_points = player->myskills.prestige.weaponPoints * 4;
vrx_check_for_levelup(player, false);

//Save the player.
Expand Down

0 comments on commit 1b88135

Please sign in to comment.