ZacharyHinds / ttt2mg-randomat

2 stars 4 forks source link

Butter minigame #14

Open Alf21 opened 4 years ago

Alf21 commented 4 years ago

https://github.com/ZacharyHinds/ttt2mg-randomat/blob/3aea4f29f00fae1f40dfbe3801bcb1467650548f/lua/minigames/minigames/sh_butter_minigame.lua#L36 This has to be defined inside the timer, because it's possible that players will get revived, those would be excluded from the minigame if it's started before they were revived.


https://github.com/ZacharyHinds/ttt2mg-randomat/blob/3aea4f29f00fae1f40dfbe3801bcb1467650548f/lua/minigames/minigames/sh_butter_minigame.lua#L43 https://github.com/ZacharyHinds/ttt2mg-randomat/blob/3aea4f29f00fae1f40dfbe3801bcb1467650548f/lua/minigames/minigames/sh_butter_minigame.lua#L54 At first, you have to check whether ply:GetActiveWeapon() IsValid. Then you can access ply:GetActiveWeapon(). Otherwise, errors will appear in edge-cases. In that way, you can store ply:GetActiveWeapon() into a var, because it will be used 3 times.


https://github.com/ZacharyHinds/ttt2mg-randomat/blob/3aea4f29f00fae1f40dfbe3801bcb1467650548f/lua/minigames/minigames/sh_butter_minigame.lua#L50-L53

Repeat-until loop as suggested here: https://github.com/ZacharyHinds/ttt2mg-randomat/issues/11

BUT this isn't needed (same as https://github.com/ZacharyHinds/ttt2mg-randomat/blob/3aea4f29f00fae1f40dfbe3801bcb1467650548f/lua/minigames/minigames/sh_butter_minigame.lua#L41) because if the list of alive players is created right in time, then there is no reason why the list should contain spec players.