Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Code
#1
AddChar
Find and Remove:
Code:
' Prevent being me
            If LCase(Trim(Name)) = "consty" Then
                Call AlertMsg(Index, "Lets get one thing straight, you are not me, ok? :)")
                Exit Sub
            End If

Weather
This is not so much of a bug fix, but it's useless code unless you add a weather system to your game. So do not remove this if you have or going to add a weather system.
Server Side
Find and Remove:
Code:
'WeatherSeconds = WeatherSeconds + 1
    'TimeSeconds = TimeSeconds + 1
    
    ' Lets change the weather if its time to
    If WeatherSeconds >= 60 Then
        i = Int(Rnd * 3)
        If i  GameWeather Then
            GameWeather = i
            Call SendWeatherToAll
        End If
        WeatherSeconds = 0
    End If
    
    ' Check if we need to switch from day to night or night to day
    If TimeSeconds >= 60 Then
        If GameTime = TIME_DAY Then
            GameTime = TIME_NIGHT
        Else
            GameTime = TIME_DAY
        End If
        
        Call SendTimeToAll
        TimeSeconds = 0
    End If
Find and Remove:
Code:
' Used for weather effects
Public GameWeather As Long
Public WeatherSeconds As Long
Public GameTime As Long
Public TimeSeconds As Long
Find and Remove:
Code:
' Init atmosphere
    GameWeather = WEATHER_NONE
    WeatherSeconds = 0
    GameTime = TIME_DAY
    TimeSeconds = 0
Find and Remove:
Code:
' Weather constants
Public Const WEATHER_NONE = 0
Public Const WEATHER_RAINING = 1
Public Const WEATHER_SNOWING = 2

' Time constants
Public Const TIME_DAY = 0
Public Const TIME_NIGHT = 1
Find and Remove:
Code:
Sub SendWeatherTo(ByVal Index As Long)
Dim Packet As String

    Packet = "WEATHER" & SEP_CHAR & GameWeather & SEP_CHAR & END_CHAR
    Call SendDataTo(Index, Packet)
End Sub

Sub SendWeatherToAll()
Dim i As Long

    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
            Call SendWeatherTo(i)
        End If
    Next i
End Sub

Sub SendTimeTo(ByVal Index As Long)
Dim Packet As String

    Packet = "TIME" & SEP_CHAR & GameTime & SEP_CHAR & END_CHAR
    Call SendDataTo(Index, Packet)
End Sub

Sub SendTimeToAll()
Dim i As Long

    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
            Call SendTimeTo(i)
        End If
    Next i
End Sub

Client Side
Find and Remove:
Code:
' Weather constants
Public Const WEATHER_NONE = 0
Public Const WEATHER_RAINING = 1
Public Const WEATHER_SNOWING = 2

' Time constants
Public Const TIME_DAY = 0
Public Const TIME_NIGHT = 1
Find and Remove:
Code:
' Used for atmosphere
Public GameWeather As Long
Public GameTime As Long
Find and Remove:
Code:
' ::::::::::::::::::::
    ' :: Weather packet ::
    ' ::::::::::::::::::::
    If (LCase(Parse(0)) = "weather") Then
        GameWeather = Val(Parse(1))
    End If

    ' :::::::::::::::::
    ' :: Time packet ::
    ' :::::::::::::::::
    If (LCase(Parse(0)) = "time") Then
        GameTime = Val(Parse(1))
    End If
Thats all useless code unless you add a weather system.
Reply
#2
Just a suggestion, better to comment them out then they dont affect your program anymore but are there for the future :wink:.
Reply
#3
Fox Wrote:Just a suggestion, better to comment them out then they dont affect your program anymore but are there for the future :wink:.
Bad idea to keep comenting everything, its easy to get the code back now when it is here Tongue
Reply
#4
Really? I thought comments were not seen at runtime? o.0
Reply
#5
Fox Wrote:Really? I thought comments were not seen at runtime? o.0
It is not there at runtime. But the thing is the programming style, it's bad idea to comment out everything, it will just mess things up. The same goes for indents.
Reply
#6
So its not really bad... just if your hyper neat like you ^_^
Reply
#7
Fox Wrote:So its not really bad... just if your hyper neat like you ^_^
Doesn't comments make the .exe bigger?
Reply
#8
I remember there being a discussion about this before. There was no real final answer I think. It might not effect much. We all program in different ways. Myself only have those things in the game that is being used. Other stuffs just take up place.
Reply
#9
Why would comments be compiled into native code?

They are there IDE but on in the .exe

Of course, you could be a little swot and go paste 1000 lines of commented code and 1000 lines of uncommented and see if they change the .exe
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#10
Comments do not effect the size of the exe. So comment it if you wish.
Reply
#11
but you just said they did ;_;
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#12
Kite, I wrote:
William Wrote:I remember there being a discussion about this before. There was no real final answer I think. It might not effect much.
I was not sure if comments effected it something. But now I know that they dont.
Reply
#13
Comments 1 William 0

haha only joking Big Grin

Its good to know that it isnt in the .exe, useful thread even if its just for that Smile
Reply
#14
William Wrote:The same goes for indents.

Dammit man... i hate it sooooo much when people don't properly nest code (in ANY language)... i should probably just start a topic about it in rants/raves, but how people can go through and code without nesting just blows me away. I can't function properly in different IDEs with improperly nested code. (Not pointed at you william, you just brought it up, so i thought i'd rant about it)
Reply
#15
What are you talking about Obsidian? There has been no discussion about nesting here..

We discussed about commenting not affecting the exe size.. ??
Reply
#16
You brought up 'indenting'. Indenting = Nesting
Reply
#17
just use CodeFixer. It will comment out anything that's not used or called, and will save a few bytes when compiling Tongue
Reply
#18
Obsidian Wrote:You brought up 'indenting'. Indenting = Nesting
Yeah guess I did Tongue Anyway, my indents might be too big,.
Reply
#19
I keep it simple, Tab.
Makes lines a bit long at times, but I like having a homogenous structure.
Reply
#20
ShadowLife Wrote:I keep it simple, Tab.
Makes lines a bit long at times, but I like having a homogenous structure.

Heheh. Homo. Anyway, just keep it as two space indent. Makes it look a lot neater.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)