[BugFix] Check Tax Display

05/28/2016 18:16 Pumaaa#1
In function

Code:
CWndSecretRoomChangeTaxRate::SetDefaultTax
Replace

Code:
m_nDefaultPurchaseTax	= (int)( CTax::GetInstance()->GetSalesTaxRate( nCont ) * 100 );
with

Code:
m_nDefaultPurchaseTax	= (int)( CTax::GetInstance()->GetPurchaseTaxRate( nCont ) * 100 );
05/28/2016 19:21 Wanetrain#2
Quote:
Originally Posted by Pumaaa View Post
In function

Code:
CWndSecretRoomChangeTaxRate::SetDefaultTax
Replace

Code:
m_nDefaultPurchaseTax	= (int)( CTax::GetInstance()->GetSalesTaxRate( nCont ) * 100 );
with

Code:
m_nDefaultPurchaseTax	= (int)( CTax::GetInstance()->GetPurchaseTaxRate( nCont ) * 100 );
Bittttttteeeeeee

Quote:
m_nDefaultPurchaseTax = static_cast< int >( CTax::GetInstance()->GetPurchaseTaxRate( nCount ) * 100 );
#ThingsEpvpDoes
05/28/2016 21:15 死神先生#3
Quote:
Originally Posted by Wanetrain View Post
Bittttttteeeeeee



#ThingsEpvpDoes
Kannst du das erklären?

M.E. ist ein C-Style Cast valides C++.
05/28/2016 22:40 Blouflash#4
Quote:
Originally Posted by 死神先生 View Post
Kannst du das erklären?

M.E. ist ein C-Style Cast valides C++.
  • static_cast<>() gives you a compile time checking ability, C-Style cast doesn't.
  • static_cast<>() is more readable and can be spotted easily anywhere inside a C++ source code, C_Style cast is'nt.
  • Intentions are conveyed much better using C++ casts.
05/28/2016 23:25 死神先生#5
Quote:
Originally Posted by Blouflash View Post
  • static_cast<>() gives you a compile time checking ability, C-Style cast doesn't.
  • static_cast<>() is more readable and can be spotted easily anywhere inside a C++ source code, C_Style cast is'nt.
  • Intentions are conveyed much better using C++ casts.
Why do I need compile time checks for numeric casts? It won't cause runtime issues anyway.
That's a matter of opinion
That's a matter of opinion
05/29/2016 11:00 macboyem07#6
after killing lucifer I change the tax but the tax not saving and also the occupied guild..
[Only registered and activated users can see links. Click Here To Register...]
05/29/2016 12:57 Sedrika#7
Your title says you're a developer so look for yourself
05/29/2016 20:19 Pumaaa#8
Quote:
Originally Posted by macboyem07 View Post
after killing lucifer I change the tax but the tax not saving and also the occupied guild..
[Only registered and activated users can see links. Click Here To Register...]
Taxes are applied only when the LUA function succeeds the time check or a GM executes /tan. Which is only available if you enabled commands beyond /open for all languages not only korean.
05/31/2016 04:21 Pumaaa#9
Quote:
Originally Posted by Wanetrain View Post
Bittttttteeeeeee



#ThingsEpvpDoes
The return value and the tax value itself is a float and shouldn't be displayed as integer anyway. So best practice would be to rewrite the window to display the correct value.

But for a matter of simplicity i just included the basic "fix" so people can implement it without having to worry about further aspects.

Wether you use a C-Style cast or static is quite irrelevant here, the code design is still bad.

EDIT:
FML double post
05/31/2016 10:59 Mognakor#10
Quote:
Originally Posted by Pumaaa View Post
The return value and the tax value itself is a float and shouldn't be displayed as integer anyway. So best practice would be to rewrite the window to display the correct value.
Unless you can set the tax rate to the fraction of a percent, it doesn't matter if it's integer or float.