[Cleanup] Cleanup spell and max level bucket logic. (#2181)

* [Cleanup] Cleanup spell and max level bucket logic.
- Spell buckets will now allow new mob->SetBucket() buckets since most people use these now.
- Max level bucket will now allow new mob->SetBucket() bucket since most people use these now.
- Clean up GetScribeableSpells() and GetLearnableDisciplines() logic and magic numbers.
- Make GetClientMaxLevel() uint8 instead of int since it can only be 0-255.

* Fix typo from other commit.

* Lua setter.

* Update client.cpp
This commit is contained in:
Kinglykrab
2022-05-28 14:35:17 -04:00
committed by GitHub
parent c8f6dbb86d
commit 9e9ef6809b
9 changed files with 164 additions and 159 deletions
+4 -4
View File
@@ -4759,12 +4759,12 @@ XS(XS_Client_SetClientMaxLevel); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SetClientMaxLevel) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::SetClientMaxLevel(THIS, int in_level)");
Perl_croak(aTHX_ "Usage: Client::SetClientMaxLevel(THIS, uint8 max_level)");
{
Client* THIS;
int in_level = (int)SvUV(ST(1));
uint8 max_level = (uint8) SvUV(ST(1));
VALIDATE_THIS_IS_CLIENT;
THIS->SetClientMaxLevel(in_level);
THIS->SetClientMaxLevel(max_level);
}
XSRETURN_EMPTY;
}
@@ -4776,7 +4776,7 @@ XS(XS_Client_GetClientMaxLevel) {
Perl_croak(aTHX_ "Usage: Client::GetClientMaxLevel(THIS)");
{
Client* THIS;
int RETVAL;
uint8 RETVAL;
dXSTARG;
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetClientMaxLevel();