Skip to content

Commit

Permalink
Added constant for fists weapon ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Dec 15, 2024
1 parent 95fdf0b commit 3ff5462
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions OpenTESArena/src/Items/ArenaItemUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace ArenaItemUtils
// Converts Arena weight units to kilograms.
constexpr double KilogramsDivisor = 256.0;

constexpr int FistsWeaponID = -1;
constexpr int RangedWeaponIDs[] = { 16, 17 };
}

Expand Down
4 changes: 2 additions & 2 deletions OpenTESArena/src/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "../Game/Game.h"
#include "../Game/GameState.h"
#include "../Game/Options.h"
#include "../Items/ArenaItemUtils.h"
#include "../Items/ItemLibrary.h"
#include "../Math/Constants.h"
#include "../Math/Quaternion.h"
Expand Down Expand Up @@ -126,8 +127,7 @@ namespace
weapons.set(i, charClassDef.getAllowedWeapon(i));
}

// Fists.
weapons.set(allowedWeaponCount, -1);
weapons.set(allowedWeaponCount, ArenaItemUtils::FistsWeaponID);

const int randIndex = random.next(weapons.getCount());
return weapons.get(randIndex);
Expand Down

0 comments on commit 3ff5462

Please sign in to comment.