Jump to content
  • 0

return 0; vs return false;


chowking

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

hey guys, i've modded soul link of blacksmith and starglad to have parry skill, and now im editing it so the blacksmith and SG can use parry with 1h axes and books,

so i did this code

 

this works when i use return 0; but following the codes now using return false in checks, i cant seem to work around it

bottom line is , is it safe to use return 0; there and wont affect other functions in rAthena if not, please help me get around the return false check;

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

EDIT: FIXED,so i removed the code

Edited by chowking
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Because zero and false have different purposes, as they are different things. 
In a condition statement, zero and false are treated as the same thing. 
Sometimes you need to find zero without being false.

Using return 0, will return zero, which is a number.

Using return false says that there is nothing to return, or don't return.

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...