Skip to content

Commit

Permalink
SmrPlayer: return getPlottedCourse by value
Browse files Browse the repository at this point in the history
Modify all places that call `getPlottedCourse` to return by value.

See smrealms#317.
  • Loading branch information
hemberger committed May 16, 2018
1 parent 02f426f commit 42b46ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Default/SmrPlayer.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ class SmrPlayer extends AbstractSmrPlayer {
WHERE '.$this->SQL.' AND message_type_id = ' . $this->db->escapeNumber($messageTypeID));
}

public function &getPlottedCourse() {
public function getPlottedCourse() {
if(!isset($this->plottedCourse)) {
require_once(get_file_loc('Plotter.class.inc'));
// check if we have a course plotted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
if($ThisPlayer->hasPlottedCourse()) {
$PlottedCourse =& $ThisPlayer->getPlottedCourse();
$PlottedCourse = $ThisPlayer->getPlottedCourse();
$CancelCourseHREF = SmrSession::getNewHREF(create_container('course_plot_cancel_processing.php'));
$ReplotCourseHREF = SmrSession::getNewHREF(create_container('course_plot_processing.php', '', array('to' => $PlottedCourse->getEndSectorID(), 'from' => $ThisSector->getSectorID())));
$NextSector =& SmrSector::getSector($ThisPlayer->getGameID(),$PlottedCourse->getNextOnPath(),$ThisPlayer->getAccountID()); ?>
Expand Down

0 comments on commit 42b46ba

Please sign in to comment.