mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9164] Use enum for CONFIG_SKIP_CINEMATICS values.
Just small code cleanup ;)
This commit is contained in:
parent
6c7e0fccd2
commit
1e8e8f5fd2
2 changed files with 14 additions and 6 deletions
|
|
@ -39,6 +39,14 @@
|
||||||
#include "ArenaTeam.h"
|
#include "ArenaTeam.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
|
|
||||||
|
// config option SkipCinematics supported values
|
||||||
|
enum CinematicsSkipMode
|
||||||
|
{
|
||||||
|
CINEMATICS_SKIP_NONE = 0,
|
||||||
|
CINEMATICS_SKIP_SAME_RACE = 1,
|
||||||
|
CINEMATICS_SKIP_ALL = 2,
|
||||||
|
};
|
||||||
|
|
||||||
class LoginQueryHolder : public SqlQueryHolder
|
class LoginQueryHolder : public SqlQueryHolder
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
@ -321,17 +329,17 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AllowTwoSideAccounts = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
bool AllowTwoSideAccounts = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
||||||
uint32 skipCinematics = sWorld.getConfig(CONFIG_SKIP_CINEMATICS);
|
CinematicsSkipMode skipCinematics = CinematicsSkipMode(sWorld.getConfig(CONFIG_SKIP_CINEMATICS));
|
||||||
|
|
||||||
bool have_same_race = false;
|
bool have_same_race = false;
|
||||||
|
|
||||||
// if 0 then allowed creating without any characters
|
// if 0 then allowed creating without any characters
|
||||||
bool have_req_level_for_heroic = (req_level_for_heroic==0);
|
bool have_req_level_for_heroic = (req_level_for_heroic==0);
|
||||||
|
|
||||||
if(!AllowTwoSideAccounts || skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT)
|
if(!AllowTwoSideAccounts || skipCinematics == CINEMATICS_SKIP_SAME_RACE || class_ == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
QueryResult *result2 = CharacterDatabase.PQuery("SELECT level,race,class FROM characters WHERE account = '%u' %s",
|
QueryResult *result2 = CharacterDatabase.PQuery("SELECT level,race,class FROM characters WHERE account = '%u' %s",
|
||||||
GetAccountId(), (skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1");
|
GetAccountId(), (skipCinematics == CINEMATICS_SKIP_SAME_RACE || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1");
|
||||||
if(result2)
|
if(result2)
|
||||||
{
|
{
|
||||||
uint32 team_= Player::TeamForRace(race_);
|
uint32 team_= Player::TeamForRace(race_);
|
||||||
|
|
@ -382,7 +390,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
// search same race for cinematic or same class if need
|
// search same race for cinematic or same class if need
|
||||||
// TODO: check if cinematic already shown? (already logged in?; cinematic field)
|
// TODO: check if cinematic already shown? (already logged in?; cinematic field)
|
||||||
while ((skipCinematics == 1 && !have_same_race) || class_ == CLASS_DEATH_KNIGHT)
|
while ((skipCinematics == CINEMATICS_SKIP_SAME_RACE && !have_same_race) || class_ == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
if(!result2->NextRow())
|
if(!result2->NextRow())
|
||||||
break;
|
break;
|
||||||
|
|
@ -445,7 +453,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((have_same_race && skipCinematics == 1) || skipCinematics == 2)
|
if ((have_same_race && skipCinematics == CINEMATICS_SKIP_SAME_RACE) || skipCinematics == CINEMATICS_SKIP_ALL)
|
||||||
pNewChar->setCinematic(1); // not show intro
|
pNewChar->setCinematic(1); // not show intro
|
||||||
|
|
||||||
// Player created, save it now
|
// Player created, save it now
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9163"
|
#define REVISION_NR "9164"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue