• 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

46.0
/pol-core/pol/module/boatmod.cpp
1
/** @file
2
 *
3
 * @par History
4
 * - 2006/09/26 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule
5
 * - 2009/09/03 MuadDib:   Changes for account related source file relocation
6
 *                         Changes for multi related source file relocation
7
 */
8

9

10
#include "boatmod.h"
11
#include <stddef.h>
12

13
#include "../../bscript/berror.h"
14
#include "../../clib/rawtypes.h"
15
#include "../../plib/uconst.h"
16
#include "../multi/boat.h"
17
#include "../multi/multi.h"
18
#include "../realms/realm.h"
19

20
#include <module_defs/boat.h>
21

22

23
namespace Pol::Module
24
{
25
UBoatExecutorModule::UBoatExecutorModule( Bscript::Executor& exec )
371✔
26
    : Bscript::TmplExecutorModule<UBoatExecutorModule, Core::PolModule>( exec )
371✔
27
{
28
}
371✔
29

30
Bscript::BObjectImp* UBoatExecutorModule::mf_MoveBoat()
51✔
31
{
32
  Multi::UBoat* boat = nullptr;
51✔
33
  int direction, speed;
34
  if ( getUBoatParam( 0, boat ) && getParam( 1, direction, 0, 7 ) && getParam( 2, speed, 1, 4 ) )
51✔
35
  {
36
    Core::UFACING move_dir = static_cast<Core::UFACING>( direction & 7 );
51✔
37
    return new Bscript::BLong( boat->move( move_dir, static_cast<u8>( speed ), false ) );
51✔
38
  }
39
  return nullptr;
×
40
}
41

42
Bscript::BObjectImp* UBoatExecutorModule::mf_MoveBoatXY()
8✔
43
{
44
  Multi::UBoat* boat = nullptr;
8✔
45
  Core::Pos2d pos;
8✔
46
  if ( getUBoatParam( 0, boat ) && getPos2dParam( 1, 2, &pos, boat->realm() ) )
8✔
47
    return new Bscript::BLong( boat->move_to( Core::Pos4d( pos, boat->z(), boat->realm() ), 0 ) );
8✔
48
  return new Bscript::BError( "Invalid Parameter type" );
×
49
}
50

51
Bscript::BObjectImp* UBoatExecutorModule::mf_TurnBoat()
4✔
52
{
53
  Multi::UBoat* boat = nullptr;
4✔
54
  int relative_dir;
55
  if ( getUBoatParam( 0, boat ) && getParam( 1, relative_dir ) )
4✔
56
  {
57
    relative_dir &= 3;
4✔
58
    return new Bscript::BLong(
59
        boat->turn( static_cast<Multi::UBoat::RELATIVE_DIR>( relative_dir ) ) );
4✔
60
  }
61

NEW
62
  return new Bscript::BError( "Invalid Parameter type" );
×
63
}
64

65
Bscript::BObjectImp* UBoatExecutorModule::mf_MoveBoatRelative()
7✔
66
{
67
  Multi::UBoat* boat = nullptr;
7✔
68
  int direction, speed;
69
  if ( getUBoatParam( 0, boat ) && getParam( 1, direction, 0, 7 ) && getParam( 2, speed, 1, 4 ) )
7✔
70
  {
71
    Core::UFACING move_dir = static_cast<Core::UFACING>( direction & 7 );
7✔
72
    return new Bscript::BLong( boat->move( move_dir, static_cast<u8>( speed ), true ) );
7✔
73
  }
74
  return nullptr;
×
75
}
76

77
Bscript::BObjectImp* UBoatExecutorModule::mf_RegisterItemWithBoat()
×
78
{
79
  Multi::UBoat* boat = nullptr;
×
80
  Core::UObject* obj = nullptr;
×
81
  if ( getUBoatParam( 0, boat ) && getUObjectParam( 1, obj ) )
×
82
  {
83
    boat->register_object( obj );
×
84
    return new Bscript::BLong( 1 );
×
85
  }
86
  return nullptr;
×
87
}
88

89
Bscript::BObjectImp* UBoatExecutorModule::mf_SystemFindBoatBySerial()
×
90
{
91
  Multi::UBoat* boat = nullptr;
×
92
  if ( getUBoatParam( 0, boat ) )
×
93
  {
94
    return boat->make_ref();
×
95
  }
96

NEW
97
  return new Bscript::BError( "Boat not found." );
×
98
}
99

100
Bscript::BObjectImp* UBoatExecutorModule::mf_BoatFromItem()
×
101
{
102
  Items::Item* item = nullptr;
×
103
  if ( getItemParam( 0, item ) )
×
104
  {
105
    if ( item->ismulti() )
×
106
    {
107
      Multi::UMulti* multi = static_cast<Multi::UMulti*>( item );
×
108
      Multi::UBoat* boat = multi->as_boat();
×
109
      if ( boat != nullptr )
×
110
        return boat->make_ref();
×
NEW
111
      return new Bscript::BError( "Multi wasn't a boat" );
×
112
    }
113

NEW
114
    return new Bscript::BError( "Item wasn't a multi" );
×
115
  }
116

NEW
117
  return new Bscript::BError( "Invalid parameter type." );
×
118
}
119
}  // namespace Pol::Module
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