FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

#16 - Unlimited Ammo on Arena (ADDED-CLOSED)

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Sun Jul 15, 2012 11:07 am    Post subject: #16 - Unlimited Ammo on Arena (ADDED-CLOSED) Reply with quote

Ticket url
https://sourceforge.net/p/dropshock/tickets/16/

Files

process_turn.php
process_arena.php
process_deploy_arena.php

deploy_arena.php insert on line 124

Code:

<input type=checkbox onfocus='this.blur();' id='unlimitedammo' name='unlimitedammo' class='checkB' > <label for='unlimitedammo'>Unlimited Ammo</label><br>


process_deploy_arena.php insert on line 85

Code:

if ($_POST["unlimitedammo"] != "on") { $pText .= "\$pOpt['unlimitedammo'] = 'N';\n"; $pDesc .= "<span class='alerttext'>No unlimited Ammo</span><br>"; } else { $pText .= "\$pOpt['unlimitedammo'] = 'Y';\n"; }


process_turn.php on 5584
Code:

if( ($planet_arena=="N") ||  ($pOpt['unlimitedammo'] == "N") ) 
                 $weapon->i_ammo -=1;


updated, no removal of ammo if unlimited


Last edited by khaibar on Mon Jul 16, 2012 8:21 am; edited 2 times in total
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sun Jul 15, 2012 6:29 pm    Post subject: Reply with quote

1k seem arbitrary and hacky.

Why not just have a "No Ammo" option that skips the removal of ammo in process_turn?
_________________

Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Mon Jul 16, 2012 8:23 am    Post subject: Reply with quote

updated

reopened ticket, hope u don't mind
don't wanna spam tickets with same purpose
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Fri Jul 20, 2012 5:43 am    Post subject: Reply with quote

Added to source w/ tweaks (see ticket),

_f
_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group