mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 21:18:43 +02:00
repairs to cost calculations for voxels
This commit is contained in:
parent
ff889882ce
commit
2c8808e922
2 changed files with 7 additions and 6 deletions
|
@ -171,7 +171,8 @@ void DomainHandler::settingsRequestFinished() {
|
|||
qDebug() << "Error getting domain settings -" << settingsReply->errorString() << "- retrying";
|
||||
|
||||
if (++_failedSettingsRequests >= MAX_SETTINGS_REQUEST_FAILED_ATTEMPTS) {
|
||||
qDebug() << "Failed to retreive domain-server settings" << MAX_SETTINGS_REQUEST_FAILED_ATTEMPTS << "times. Re-setting connection to domain.";
|
||||
qDebug() << "Failed to retreive domain-server settings" << MAX_SETTINGS_REQUEST_FAILED_ATTEMPTS
|
||||
<< "times. Re-setting connection to domain.";
|
||||
clearSettings();
|
||||
clearConnectionInfo();
|
||||
emit settingsReceiveFail();
|
||||
|
|
|
@ -147,14 +147,14 @@ qint64 VoxelEditPacketSender::satoshiCostForMessage(const VoxelDetail& details)
|
|||
const DomainHandler& domainHandler = NodeList::getInstance()->getDomainHandler();
|
||||
|
||||
qint64 totalSatoshiCost = domainHandler.getSatoshisPerVoxel();
|
||||
|
||||
qint64 costPerMeterCubed = domainHandler.getSatoshisPerMeterCubed();
|
||||
|
||||
if (totalSatoshiCost == 0 && costPerMeterCubed == 0) {
|
||||
float totalVolume = details.s * details.s * details.s;
|
||||
|
||||
return totalSatoshiCost + floorf(totalVolume * costPerMeterCubed);
|
||||
} else {
|
||||
return 0;
|
||||
} else {
|
||||
float meterScale = details.s * TREE_SCALE;
|
||||
float totalVolume = meterScale * meterScale * meterScale;
|
||||
|
||||
return totalSatoshiCost + (qint64) floorf(totalVolume * costPerMeterCubed);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue