Changeset 442

Show
Ignore:
Timestamp:
08/04/09 12:07:41 (11 years ago)
Author:
kovell
Message:

Kill value correctly updated when a kill is added and re-added.

Location:
dev/common/includes
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/class.kill.php

    r439 r442  
    926926        } 
    927927        //! Calculate the current cost of a ship loss excluding blueprints. 
    928         function calculateISKLoss() 
     928 
     929        //! \param $update set true to update all-time summaries. 
     930        function calculateISKLoss($update = true) 
    929931        { 
    930932                $value = 0; 
     
    943945                } 
    944946                $value += $this->victimship_->getPrice(); 
    945                 if($this->iskloss_) summaryCache::update($this, $value - $this->iskloss_); 
     947                if($this->iskloss_ && $update) summaryCache::update($this, $value - $this->iskloss_); 
    946948                $this->iskloss_ = $value; 
    947949                return $value; 
     
    980982                        return 0; 
    981983                } 
     984                // If value isn't already calculated then do so now. Don't update the 
     985                // stored value since at this point it does not exist. 
     986                if(!is_numeric($this->iskloss_)) $this->calculateISKLoss(false); 
    982987 
    983988                $dupe = $this->getDupe(true); 
     
    10351040                if($this->externalid_) $sql .= $this->externalid_.", "; 
    10361041                else $sql .= "NULL, "; 
    1037         $sql .= $this->calculateISKLoss()." )"; 
     1042        $sql .= $this->getISKLoss()." )"; 
    10381043                $qry->autocommit(false); 
    10391044                if(!$qry->execute($sql)) 
  • dev/common/includes/globals.php

    r441 r442  
    77else 
    88{ 
    9         $svn_rev = '441'; 
     9        $svn_rev = '442'; 
    1010} 
    1111define('SVN_REV', $svn_rev);