• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 21108840797

18 Jan 2026 08:35AM UTC coverage: 60.508% (+0.02%) from 60.492%
21108840797

push

github

web-flow
ClangTidy readability-else-after-return (#857)

* trigger tidy

* Automated clang-tidy change: readability-else-after-return

* compile test

* rerun

* Automated clang-tidy change: readability-else-after-return

* trigger..

* Automated clang-tidy change: readability-else-after-return

* manually removed a few

* Automated clang-tidy change: readability-else-after-return

* removed duplicate code

* fix remaining warnings

* fixed scope

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>

837 of 1874 new or added lines in 151 files covered. (44.66%)

46 existing lines in 25 files now uncovered.

44448 of 73458 relevant lines covered (60.51%)

525066.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.27
/pol-core/pol/uoskills.cpp
1
/** @file
2
 *
3
 * @par History
4
 */
5

6

7
#include "uoskills.h"
8

9
#include <stddef.h>
10

11
#include "../clib/cfgelem.h"
12
#include "../plib/pkg.h"
13
#include "globals/uvars.h"
14
#include "mobile/attribute.h"
15
#include "skillid.h"
16

17

18
namespace Pol::Core
19
{
20
const UOSkill& GetUOSkill( unsigned skillid )
290✔
21
{
22
  if ( skillid < gamestate.uo_skills.size() )
290✔
23
    return gamestate.uo_skills[skillid];
290✔
NEW
24
  throw std::runtime_error( "Bad UO Skill ID" );
×
25
}
26

27
UOSkill::UOSkill( const Plib::Package* pkg, Clib::ConfigElem& elem )
141✔
28
    : inited( true ),
141✔
29
      skillid( strtoul( elem.rest(), nullptr, 10 ) ),
141✔
30
      attributename( elem.remove_string( "Attribute", "" ) ),
141✔
31
      pAttr( nullptr ),
141✔
32
      pkg( pkg )
141✔
33
{
34
  if ( skillid >= 500 )
141✔
35
    elem.throw_error( "SkillID must be < 500" );
×
36

37
  if ( !attributename.empty() )
141✔
38
  {
39
    bool required = false;
141✔
40
    if ( attributename[0] == '+' )
141✔
41
    {
42
      required = true;
×
43
      attributename = attributename.substr( 1, std::string::npos );
×
44
    }
45
    pAttr = Mobile::Attribute::FindAttribute( attributename );
141✔
46
    if ( !pAttr )
141✔
47
    {
48
      if ( required )
×
49
      {
50
        elem.throw_error( "Attribute " + attributename + " not found." );
×
51
      }
52
      else
53
      {
54
        elem.warn( "Attribute " + attributename + " not found." );
×
55
      }
56
    }
57
  }
58
}
141✔
59
UOSkill::UOSkill()
174✔
60
    : inited( false ), skillid( 0 ), attributename( "" ), pAttr( nullptr ), pkg( nullptr )
174✔
61
{
62
}
174✔
63

64
size_t UOSkill::estimateSize() const
58✔
65
{
66
  return sizeof( UOSkill ) + attributename.capacity();
58✔
67
}
68

69
void load_skill_entry( const Plib::Package* pkg, Clib::ConfigElem& elem )
141✔
70
{
71
  UOSkill uoskill( pkg, elem );
141✔
72

73
  if ( uoskill.skillid >= gamestate.uo_skills.size() )
141✔
74
    gamestate.uo_skills.resize( uoskill.skillid + 1 );
×
75

76
  if ( gamestate.uo_skills[uoskill.skillid].inited )
141✔
77
  {
78
    elem.throw_error( "UOSkill " + std::to_string( uoskill.skillid ) + " already defined by " +
×
79
                      gamestate.uo_skills[uoskill.skillid].pkg->desc() );
×
80
  }
81

82
  gamestate.uo_skills[uoskill.skillid] = uoskill;
141✔
83
}
141✔
84

85
void load_uoskills_cfg()
3✔
86
{
87
  gamestate.uo_skills.resize( SKILLID__COUNT );
3✔
88
  Plib::load_packaged_cfgs( "uoskills.cfg", "Skill", load_skill_entry );
3✔
89
}
3✔
90

91
void clean_skills()
3✔
92
{
93
  gamestate.uo_skills.clear();
3✔
94
}
3✔
95
}  // namespace Pol::Core
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc