• 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

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

6
#include "door.h"
7

8
#include <stddef.h>
9

10
#include "bscript/executor.h"
11
#include "clib/rawtypes.h"
12

13
#include "base/vector.h"
14
#include "globals/uvars.h"
15
#include "item/itemdesc.h"
16
#include "network/client.h"
17
#include "syshookscript.h"
18
#include "ufunc.h"
19
#include "uworld.h"
20

21

22
namespace Pol::Core
23
{
24
UDoor::UDoor( const Items::DoorDesc& descriptor ) : ULockable( descriptor, UOBJ_CLASS::CLASS_ITEM )
×
25
{
26
}
×
27

28
void UDoor::builtin_on_use( Network::Client* client )
×
29
{
30
  if ( locked() )
×
31
  {
32
    private_say_above( client->chr, this, "That is locked." );
×
33
  }
34
  else
35
  {
36
    toggle();
×
37
  }
38
}
×
39

40
void UDoor::toggle()
×
41
{
42
  const Items::DoorDesc* dd = static_cast<const Items::DoorDesc*>( &itemdesc() );
×
43

44
  Pos4d oldpos = pos();
×
45

46
  set_dirty();
×
47
  if ( is_open() )
×
48
  {
49
    if ( dd->graphic )
×
50
      graphic = dd->graphic;
×
51
    else
52
      graphic = static_cast<u16>( objtype_ );
×
53
    setposition( pos() - dd->mod );
×
54
  }
55
  else
56
  {
57
    graphic = dd->open_graphic;
×
58
    setposition( pos() + dd->mod );
×
59
  }
60

61
  MoveItemWorldPosition( oldpos, this );
×
62

63
  send_item_to_inrange( this );
×
64
}
×
65

66
bool UDoor::is_open() const
×
67
{
68
  const Items::DoorDesc* dd = static_cast<const Items::DoorDesc*>( &itemdesc() );
×
69
  if ( graphic == dd->open_graphic )
×
70
    return true;
×
NEW
71
  return false;
×
72
}
73

74
void UDoor::open()
×
75
{
76
  if ( !is_open() )
×
77
    toggle();
×
78
}
×
79

80
void UDoor::close()
×
81
{
82
  if ( is_open() )
×
83
    toggle();
×
84
}
×
85

86
size_t UDoor::estimatedSize() const
×
87
{
88
  return base::estimatedSize();
×
89
}
90

91
bool UDoor::get_method_hook( const char* methodname, Bscript::Executor* ex, ExportScript** hook,
×
92
                             unsigned int* PC ) const
93
{
94
  if ( gamestate.system_hooks.get_method_hook( gamestate.system_hooks.door_method_script.get(),
×
95
                                               methodname, ex, hook, PC ) )
96
    return true;
×
97
  return base::get_method_hook( methodname, ex, hook, PC );
×
98
}
99
}  // 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