File tree Expand file tree Collapse file tree 5 files changed +17
-9
lines changed Expand file tree Collapse file tree 5 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -842,10 +842,13 @@ Editor::check_save_prerequisites(const std::function<void ()>& callback) const
842
842
if (sector->get_name () == " main" )
843
843
{
844
844
sector_valid = true ;
845
- const auto & spawnpoints = sector->get_objects_by_type <SpawnPointMarker>();
846
- spawnpoint_valid = std::any_of (spawnpoints.begin (), spawnpoints.end (), [](const auto & spawnpoint) {
847
- return spawnpoint.get_name () == " main" ;
848
- });
845
+ for (const auto & spawnpoint : sector->get_objects_by_type <SpawnPointMarker>())
846
+ {
847
+ if (spawnpoint.get_name () == " main" )
848
+ {
849
+ spawnpoint_valid = true ;
850
+ }
851
+ }
849
852
}
850
853
}
851
854
Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ ScriptMenu::ScriptMenu(std::string* script_) :
31
31
// Split the script to the lines.
32
32
std::string script = *base_script;
33
33
std::string line_break = " \n " ;
34
+ std::string new_line;
34
35
size_t endl_pos = script.find (line_break);
35
36
while (endl_pos != std::string::npos) {
36
- const auto & new_line = script.substr (0 , endl_pos);
37
+ new_line = script.substr (0 , endl_pos);
37
38
script = script.substr (endl_pos + line_break.length ());
38
39
push_string (new_line);
39
40
endl_pos = script.find (line_break);
Original file line number Diff line number Diff line change 17
17
#include " interface/control_textbox.hpp"
18
18
19
19
#include < math.h>
20
- #include < numeric>
21
20
22
21
#include < SDL.h>
23
22
@@ -364,8 +363,13 @@ ControlTextbox::get_string() const
364
363
std::string
365
364
ControlTextbox::get_contents () const
366
365
{
366
+ std::string temp;
367
+
368
+ for (char c : m_charlist) {
369
+ temp += c;
370
+ }
367
371
368
- return std::accumulate (m_charlist. begin (), m_charlist. end (), " " ) ;
372
+ return temp ;
369
373
}
370
374
371
375
std::string
Original file line number Diff line number Diff line change @@ -104,10 +104,10 @@ Brick::try_break(Player* player)
104
104
return ;
105
105
106
106
SoundManager::current ()->play (" sounds/brick.wav" , get_pos ());
107
+ Player& player_one = *Sector::get ().get_players ()[0 ];
107
108
if (m_coin_counter > 0 ) {
108
109
Sector::get ().add <BouncyCoin>(get_pos (), true );
109
110
m_coin_counter--;
110
- Player& player_one = *Sector::get ().get_players ()[0 ];
111
111
player_one.get_status ().add_coins (1 );
112
112
if (m_coin_counter == 0 )
113
113
m_sprite->set_action (" empty" );
Original file line number Diff line number Diff line change 73
73
CommandLineArguments::print_acknowledgements () const
74
74
{
75
75
IFileStream in (" ACKNOWLEDGEMENTS.txt" );
76
+ std::string line;
76
77
if (in.good ())
77
78
{
78
- std::string line;
79
79
while (std::getline (in, line))
80
80
{
81
81
std::cout << line << std::endl;
You can’t perform that action at this time.
0 commit comments